Gleam - v1.0.2
    Preparing search index...

    Class EventSystem

    Synchronous, type-safe pub/sub for engine-wide events. Static-only — call as EventSystem.addEventListener(...) / EventSystem.dispatchEvent(...). Event names and payloads are constrained by GameEventMap.

    Guarantees:

    • Listeners registered during a dispatch are deferred to the next dispatch (won't fire in the round that registered them).
    • once listeners are removed before their callback runs, so nested dispatches and throwing callbacks can't double-fire them.
    • A throwing callback is caught and logged (throttled per eventName:message); siblings still receive the event.
    Index

    Constructors

    Methods

    • Synchronously fire eventName with the typed payload. Listeners are invoked in registration order; nested dispatches and self-disposing listeners are handled safely.

      Type Parameters

      Parameters

      Returns void