Function poll

  • Poll execution and use condition to accept or reject the results

    Type Parameters

    • T

    • E = any

    Parameters

    • f: (() => T | PromiseLike<T>)
        • (): T | PromiseLike<T>
        • Returns T | PromiseLike<T>

    • condition: {
          (e, result?): boolean;
          (e, result): boolean;
      }
        • (e, result?): boolean
        • Parameters

          • e: E
          • Optional result: undefined

          Returns boolean

        • (e, result): boolean
        • Parameters

          • e: null
          • result: T

          Returns boolean

    • interval: number = 1000
    • Optional timeout: number

    Returns Promise<T>

Generated using TypeDoc