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

    接口 IObservable<T>

    Represents a stateful value that can be observed by different objects.

    interface IObservable<T> {
        validator?: ObservableValidator<T>;
        value: Readonly<T>;
        set(newValue: T): boolean;
    }

    类型参数

    • T
    索引

    属性

    方法

    属性

    validator?: ObservableValidator<T>

    Optional validator that will pre-process the new value.

    value: Readonly<T>

    Current value of the observable.

    方法

    • 参数

      • newValue: T

        New value to be set (will be processed by the validator if it exists).

      返回 boolean

      Updates the value and notifies dependent objects.