• Wait for the first event to occur from a list (Promise.race pattern)

    Type Parameters

    • T = ApiCallback<string>

    Parameters

    • eventTypes: string[]

      Array of event types to race

    • Optional timeout: number

      Optional timeout in milliseconds

    Returns Promise<{
        eventType: string;
        data: T;
    }>

    Promise that resolves with the first event