Function deadline
- deadline<T>(p, ms, options?): Promise<T>
Type Parameters
Parameters
- p: Promise<T>
The promise to make rejectable.
- ms: number
Duration in milliseconds for when the promise should time out.
- options: DeadlineOptions = {}
Additional options.
Returns Promise<T>
A promise that will reject if the provided duration runs out before resolving.
- p: Promise<T>
Create a promise which will be rejected with DOMException when a given delay is exceeded.
Note: Prefer to use AbortSignal.timeout instead for the APIs that accept AbortSignal.