ecspresso
    Preparing search index...

    Function waitForEvent

    • Wait until a matching event fires on the event bus. Subscribes via eventBus.subscribe, yields until event received, unsubscribes in finally block.

      Type Parameters

      • ET extends Record<string, any>
      • E extends string

      Parameters

      • eventBus: { subscribe(type: E, cb: (data: ET[E]) => void): () => void }

        Object with subscribe method (typically ecs.eventBus)

      • eventType: E

        Event type name to listen for

      • Optionalfilter: (data: ET[E]) => boolean

        Optional predicate to filter events

      Returns CoroutineGenerator