ixfx
    Preparing search index...

    Type Alias Reactive<V>

    A Reactive

    type Reactive<V> = {
        dispose(reason: string): void;
        isDisposed(): boolean;
        on(handler: (value: Passed<V>) => void): Unsubscriber;
        onValue(handler: (value: V) => void): Unsubscriber;
        set(value: V): void;
    }

    Type Parameters

    • V
    Index

    Methods

    • Subscribes to a reactive. Receives data as well as signals. Use onValue if you just care about values.

      Return result unsubscribes.

      const unsub = someReactive.on(msg => {
      // Do something with msg.value
      });

      unsub(); // Unsubscribe

      Parameters

      • handler: (value: Passed<V>) => void

      Returns Unsubscriber