@minecraft
    正在准备搜索索引...

    类 Observable<T>实验性

    A class that represents data that can be Observed. Extensively used for UI.

    类型参数

    索引

    构造函数

    方法

    • 参数

      返回 Promise<string | TextFilteringError[]>

      Gets filtered data from the Observable (only available for strings). In case of failure, it will return an array of TextFilteringError that can provide more context about the filtering process. For testing purposes, the options are available under "Creator -> Text Filtering" settings menu. This delay is only applied to the getFilteredText function and can be used to simulate network latency when testing.

    • 参数

      • listener: (newValue: T) => void

      返回 (newValue: T) => void

      Subscribes a callback to any changes that occur to the Observable. The return value can be passed into the unsubscribe function to stop listening to changes.

    • 参数

      • listener: (newValue: T) => void

      返回 void

      Unsubscribe a callback from any changes that occur to the Observable. This takes the return value from the subscribe function.