Class EventEmitter<Events>

Event emitter class.

Type Parameters

Constructors

Properties

Methods

Constructors

Properties

A Map of event names to registered handler functions.

Methods

  • Invoke all handlers for the given type. If present, '*' handlers are invoked after type-matched handlers.

    Note: Manually firing '*' handlers is not supported.

    Type Parameters

    • Key extends string | number | symbol

    Parameters

    Returns void

  • Remove an event handler for the given type. If handler is omitted, all handlers of the given type are removed.

    Type Parameters

    • Key extends string | number | symbol

    Parameters

    • type: Key

      Type of event to unregister handler from, or '*'

    • Optionalhandler: _Handler<Events[Key]>

      Handler function to remove

    Returns void

  • Remove all event handlers.

    Returns void