Returns a promise that resolves with the specified value after a given delay.
A Promise that resolves to value after ms milliseconds.
Promise
value
ms
await resolveAfter(1000, 'hello'); // resolves with 'hello' after 1 secondawait resolveAfter(500); // resolves with undefined after 0.5 seconds
The type of the value to resolve.
The delay in milliseconds before the promise resolves.
Optional
Optional value to resolve the promise with (defaults to undefined if not provided).
undefined
Generated using TypeDoc
Returns a promise that resolves with the specified value after a given delay.
Returns
A
Promisethat resolves tovalueaftermsmilliseconds.Example
Remarks