Skip to content

withTimeout

withTimeout<T>(fn, timeout, options?): Promise<T>

Defined in: src/functions.ts:25

One-off timeout: await withTimeout(({ signal }) => fetch(url, { signal }), '2s'). Rejects with TimeoutRejectedError.

T

(context) => MaybePromise<T>

Duration | TimeoutOptions

CallOptions = {}

Promise<T>