Class CMappedEvent<T>

Mapped event listener/emitter, listen to, and trigger events. (for single events use CEvent).

Example

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

Type Parameters

  • T

Hierarchy

  • CMappedEvent

Constructors

Properties

Methods

Constructors

Properties

_listeners: Record<string, ((data?) => void)[]> = {}

Methods

  • Parameters

    • evt: string
    • Optional data: T

    Returns void

  • Parameters

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

          • Optional data: T

          Returns void

    Returns void

  • Parameters

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

          • Optional data: T

          Returns void

    Returns void

Generated using TypeDoc