Class TypedEvent<T>

Event emitter class that handles typed events.

TypedEvent

Type Parameters

  • T

Constructors

Methods

Constructors

Methods

  • Calls the registered event handler listener functions on after the other. The order in which the functions are called is not defined.

    Parameters

    • event: T

      The typed event parameter that will be provided to each listener.

    Returns Promise<void>

  • Removes a listener function from an event emitter. If it is called from inside an event handler the current event will still call the removed handler if it wasn't called so far.

    Parameters

    • listener: Listener<T>

      Function that should be removed.

    Returns void

  • Adds a listener function to an event emitter.

    Parameters

    • listener: Listener<T>

      Function that is called if the event is emitted.

    Returns Disposable

    Returns a disposable object that should be disposed when not needed anymore.

  • Adds a listener function to an event emitter that is called only once.

    Parameters

    • listener: Listener<T>

      Function that is called only once if the event is emitted.

    Returns void

  • Pipes another event emitter to this event emitter.

    Parameters

    • te: TypedEvent<T>

      Event emitter that is called after this event emitter.

    Returns Disposable

    Returns a disposable object that should be disposed when not needed anymore.