Function waitForFirstCondition

  • High level helper which runs enter/leave when selector is being matched.

    Type Parameters

    Parameters

    • conditions: T

      Object with Promises/Functions returning promises.

    Returns Promise<keyof T>

    Resolves with first resolved condition's key.

    Example

    const result = waitForFirstCondition({
    a: () => new Promise(resolve => setTimeout(() => resolve(), 1000),
    b: new Promise(resolve => setTimeout(() => resolve(), 500)
    });

Generated using TypeDoc