An Observable that proxies to another Observable.

Emits emitted here instead emit on the target Observable. Events emitted on the target emit locally via a listener installed by the proxy.

This is useful for managing a subset of Observers for an Observable.

Note that this "proxy" acts as a proxy but is not a JS Proxy.

Hierarchy (view full)

Constructors

Properties

emit: ((...payload: any) => any)

Accessors

  • get isAsync(): undefined | boolean
  • This flag indicates whether the observable is asynchronous. Any observable that accepts promise returns may be asynchronous but this information is not available at runtime unless you specify here, typically via AsyncObservable.

    Returns undefined | boolean

  • get isObserved(): boolean
  • True if there is at least one observer registered.

    Returns boolean

Methods

  • Observable supports standard "for await (const value of observable").

    Using an observer in this manner limits your listener to the first parameter normally emitted and your observer cannot return a value.

    Returns AsyncIterator<any, any, any>

  • Release resources associated with the observable.

    Returns void

  • Determine whether an observer is registered.

    Parameters

    Returns boolean

  • Remove an observer.

    Parameters

    Returns void

  • Add an observer.

    Parameters

    Returns void

  • Add an observer that emits once then is unregistered.

    Parameters

    Returns void

  • Attaches callbacks for the resolution and/or rejection of the Promise.

    Type Parameters

    • TResult1 = any[]
    • TResult2 = never

    Parameters

    • Optionalonfulfilled: null | ((value: any[]) => TResult1 | PromiseLike<TResult1>)

      The callback to execute when the Promise is resolved.

    • Optionalonrejected: null | ((reason: any) => TResult2 | PromiseLike<TResult2>)

      The callback to execute when the Promise is rejected.

    Returns PromiseLike<TResult1 | TResult2>

    A Promise for the completion of which ever callback is executed.