Class ReactiveValue<T>Abstract

A ReactiveValue is a value that

  • updates periodically,
  • can fire listeners when it updates,
  • and can be chanined together with other ReactiveValues.

A ReactiveValue is a read-only view. See MutableReactiveValue for a read-write view.

Static methods in the ReactiveValue and MutableReactiveValue classes are constructors (e.g. fromImmutable).

Avoid extending this class from an external library, as that may not be stable.

Type Parameters

  • T

Hierarchy (view full)

Constructors

Methods

  • Returns a reference to the current value of this ReactiveValue.

    The result of this should not be modified (use setValue instead).

    Returns T

  • Registers a listener that is notified when the value of this changes.

    Parameters

    • listener: UpdateCallback<T>

    Returns ListenerResult

  • Calls callback immediately, then registers callback as an onUpdateListener.

    Parameters

    • callback: UpdateCallback<T>

    Returns ListenerResult

  • Returns a promise that resolves when this value is next changed.

    Returns Promise<T>

  • Creates a ReactiveValue whose values come from callback.

    callback is called whenever any of sourceValues are updated and initially to set the initial value of the result.

    Type Parameters

    • T

    Parameters

    Returns ReactiveValue<T>

OpenSource licenses