Creates a promise that is rejected after the given amount of time. A typical use case is to wait for another promise until a specified timeout using:
Promise.race([ promiseToPerform, timeoutReject(timeout, 'Timeout error message') ]); Copy
Promise.race([ promiseToPerform, timeoutReject(timeout, 'Timeout error message') ]);
timeout in milliseconds
Optional
error message on promise rejection
rejection promise
Creates a promise that is rejected after the given amount of time. A typical use case is to wait for another promise until a specified timeout using: