Function withTimeout

  • Wrap a promise with a timeout that rejects if exceeded.

    Type Parameters

    • T

    Parameters

    • promise: Promise<T>
    • OptionaltimeoutMs: number

    Returns Promise<T>