Prelude API
    Preparing search index...

    Function timeout

    • Resolves with the result of f, or with the result of g if f does not settle within wait milliseconds. Waits above the setTimeout maximum (2^31-1 ms) are honoured by chaining timers; a non-finite wait never times out.

      Aborting signal clears the timer and rejects with signal.reason; the promise returned by f is left to settle on its own (its result is dropped), so pass the same signal to f when its work should stop too.

      Type Parameters

      • T
      • U

      Parameters

      • wait: number
      • f: () => Promise<T>
      • g: () => U
      • __namedParameters: { signal?: AbortSignal } = {}

      Returns Promise<T | U>