Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    Function raceTimeout

    • Settle with promise, or reject with onTimeout()'s value once timeoutMs elapses first. The timer is cleared as soon as promise settles. A timeoutMs of <= 0 or a non-finite one installs no timer at all and returns promise itself (the convention every timeout knob here follows).

      The race only settles the CALLER: whatever promise stands for keeps running. Callers that hold a resource for the work's duration release it when the work settles, not when the race does.

      Type Parameters

      • T

      Parameters

      • promise: Promise<T>
      • timeoutMs: number
      • onTimeout: () => unknown

        Called once when the timer fires; its return value is the rejection reason (it may also log or evict).

      Returns Promise<T>