Interface IEventDispatcher<T>

A simple event dispatcher interface with IEvent as event type.

Type Parameters

  • T

Hierarchy

  • IEventDispatcher

Implemented by

Methods

  • Adds a listener to an event type.

    Parameters

    • type: T

      The type of event to listen to.

    • listener: ((event) => void)

      The function that gets called when the event is fired.

        • (event): void
        • Parameters

          Returns void

    Returns void

  • Checks if listener is added to an event type.

    Parameters

    • type: T

      The type of event to listen to.

    • listener: ((event) => void)

      The function that gets called when the event is fired.

        • (event): void
        • Parameters

          Returns void

    Returns boolean

  • Removes a listener from an event type.

    Parameters

    • type: T

      The type of the listener that gets removed.

    • listener: ((event) => void)

      The listener function that gets removed.

        • (event): void
        • Parameters

          Returns void

    Returns void

Generated using TypeDoc