Interface SubscriptionFunctions<This, Args>

Functions used to subscribe and unsubscribe to an event.

Type Parameters

  • This

  • Args extends any[] = []

Hierarchy

Implemented by

Methods

  • Returns AsyncIterator<Args, any, undefined>

  • Create a subscribable that will apply the specified filter to any listeners added.

    Parameters

    • filter: ((this, ...args) => boolean | Promise<boolean>)

      function used to filter events

        • (this, ...args): boolean | Promise<boolean>
        • Parameters

          • this: This
          • Rest ...args: Args

          Returns boolean | Promise<boolean>

    Returns Subscribable<This, Args>

    filtered Subscription

  • Create an iterator that supports async iteration of events emitted.

    Parameters

    Returns AsyncIterableIterator<Args>

    iterable/iterator

  • Get a promise that will resolve the first time this event is fired after this call.

    Returns Promise<Args>

    promise that resolves the next time the event is fired

  • Subscribe to this event using the given listener. The listener will be invoked any time the event is emitted. The returned handle can be used to unsubscribe.

    Parameters

    • listener: Listener<This, Args>

      listener to subscribe

    Returns SubscriptionHandle

    handle to the subscription, can be used to unsubscribe

  • Unsubscribe a listener from this handler. The specified listener will no longer be invoked when the event is emitted.

    Parameters

    • listener: Listener<This, Args>

      listener to unsubscribe

    Returns void

  • Create a Subscribable that changes the this argument used for listeners.

    Type Parameters

    • NewThis

    Parameters

    • newThis: NewThis

      what should be treated as this for event listeners

    Returns Subscribable<NewThis, Args>

    modified Subscribable

Generated using TypeDoc