Function wrapPromiseInTimeout
- wrapPromiseInTimeout<T>(
duration: Readonly<Partial<Record<DurationUnit, undefined | number>>>,
originalPromise: MaybePromise<T>,
failureMessage?: string,
): Promise<T> Parameters
- duration: Readonly<Partial<Record<DurationUnit, undefined | number>>>
- originalPromise: MaybePromise<T>
Optional
failureMessage: string
Returns Promise<T>
Wraps an already-created Promise in a timeout, causing a rejection if the original Promise isn't resolved by then.