Class EventEmitter<TSender, TArgs>

Event emitter.

Type Parameters

  • TSender

    Type of the event sender

  • TArgs

    Type of the event argument

Constructors

Accessors

Methods

Constructors

Accessors

Methods

  • Subscribes to the event only once.

    Parameters

    • func: (a: TSender, b: TArgs) => void

      The event handler that is called when the event is dispatched.

    Returns () => void

    A function that unsubscribes the event handler from the event.

  • Subscribe to the event.

    Parameters

    • func: (a: TSender, b: TArgs) => void

      The event handler that is called when the event is dispatched.

    Returns () => void

    Function that unsubscribes the event handler from the event.