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.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”(context) => MaybePromise<T>
timeout
Section titled “timeout”options?
Section titled “options?”CallOptions = {}
Returns
Section titled “Returns”Promise<T>