Class Remitter<TConfig>

Type Parameters

  • TConfig = any

Constructors

Methods

  • Remove all listeners from the eventName or all events.

    Type Parameters

    • TEventName extends string | number | symbol

    Parameters

    • OptionaleventName: TEventName

      Optional eventName to clear.

    Returns void

  • Remove all listeners from ANY_EVENT.

    Returns void

  • Remove all listeners from ERROR_EVENT.

    Returns void

  • Emit an event to eventName listeners.

    Type Parameters

    • TEventName extends string | number | symbol

    Parameters

    Returns void

  • Emit an event with payload to eventName listeners.

    Type Parameters

    • TEventName extends string | number | symbol

    Parameters

    Returns void

  • If the eventName has any listener.

    Type Parameters

    • TEventName extends string | number | symbol

    Parameters

    • OptionaleventName: TEventName

      Optional eventName to check.

    Returns boolean

    true if the eventName has any listener, false otherwise. If no eventName is provided, returns true if the Remitter has any listener.

  • If the ANY_EVENT has any listener.

    Returns boolean

    true if the ANY_EVENT has any listener, false otherwise.

  • If the ERROR_EVENT has any listener.

    Returns boolean

    true if the ERROR_EVENT has any listener, false otherwise.

  • Remove a listener from the eventName.

    Type Parameters

    • TEventName extends string | number | symbol

    Parameters

    Returns void