acquiescence - v0.1.7
    Preparing search index...

    Class TimeoutWaiter<T>

    Waiter that polls for a condition to be met, with a timeout. It allows for custom intervals for polling to be used.

    Type Parameters

    • T

      The type of the result of the condition.

    Implements

    Index

    Constructors

    Methods

    Constructors

    • Initializes a new instance of the TimeoutWaiter class.

      Type Parameters

      • T

        The type of the result of the condition.

      Parameters

      • condition: () => T | Promise<T>

        {() => T | Promise} A Function testing the condition to poll for.

      • timeoutInMilliseconds: number = 0

        {number} The timeout in milliseconds. If omitted, the timeout is zero, implying the check will execute once.

      • pollIntervalsInMilliseconds: number[] = ...

        {number[]} An array of the intervals in milliseconds to poll at. If omitted, the default interval of 100ms is used.

      Returns TimeoutWaiter<T>

    Methods

    • Waits for the condition to be met.

      Returns Promise<T>

      A Promise that resolves to the result of the condition. The Promise is rejected if the timeout is reached, or if the wait is cancelled..