• Wait for an event OR get the current state if the event already happened This prevents race conditions where events fire before subscription

    Type Parameters

    • T = ApiCallback<string>

    Parameters

    • eventType: string

      The event type to wait for

    • options: StateAwareOptions<T>

      Options for state fetching and transformation

    Returns Promise<T>

    Promise that resolves with either the event data or current state