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

  • Checks if the event has a subscription for the specified handler.

    Parameters

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

      The event handler.

    Returns boolean

  • Subscribes to the event only once.

    Parameters

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

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

    Returns (() => void)

    A function that unsubscribes the event handler from the event.

      • (): void
      • Returns void

  • Subscribe to the event.

    Parameters

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

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

    Returns (() => void)

    A function that unsubscribes the event handler from the event.

      • (): void
      • Returns void

  • Subscribe to the event.

    Parameters

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

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

    Returns (() => void)

    Function that unsubscribes the event handler from the event.

      • (): void
      • Returns void

  • Unsubscribe from the event.

    Parameters

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

      The event handler that will be unsubsribed from the event.

    Returns void

  • Unsubscribe from the event.

    Parameters

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

      The event handler that will be unsubsribed from the event.

    Returns void