timeout: <T>(executor: PromiseExecutor<T>, timeout?: number) => Promise<T> = createTimeoutPromise Type declaration
- <T>(executor: PromiseExecutor<T>, timeout?: number): Promise<T>
Parameters
- executor: PromiseExecutor<T>
- timeout: number = ...
Returns Promise<T>
create a promise with timeout, if time is up but no result/error resolved by promise, will throw an error