• Runs the callback function every specified interval and returns a Promise that resolves when the callback returns truthy value. Pro-tip: Value returned from the callback is returned via resolved Promise. If you want to pass back falsy value then wrap your potential return value with an object or array.

    Type Parameters

    • T

    Parameters

    • fn: (() => T)

      callback function

        • (): T
        • Returns T

    • interval: number = DEFAULT_INTERVAL

      interval between checks

    • timeout: number = Infinity

      optional timeout

    Returns Promise<T>

Generated using TypeDoc