Class CEvent<T>

Single event listener/emitter, listen to, and trigger events. (for mapped events use CMappedEvent).

Example

const evt = new CEvent<bool>();
evt.listen(listener);
evt.dispatch(true);
evt.remove(listener);

Type Parameters

  • T

Hierarchy

  • CEvent

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • T

    Returns CEvent<T>

Properties

_listeners: ((data) => void)[] = []

Type declaration

    • (data): void
    • Parameters

      • data: undefined | T

      Returns void

Methods

  • Parameters

    • Optional data: T

    Returns void

  • Parameters

    • fn: ((data?) => void)
        • (data?): void
        • Parameters

          • Optional data: T

          Returns void

    Returns void

  • Parameters

    • fn: ((data?) => void)
        • (data?): void
        • Parameters

          • Optional data: T

          Returns void

    Returns void

Generated using TypeDoc