@wezom/toolkit-promise
Useful tools for working with Promises
Statements | Branches | Functions | Lines |
---|---|---|---|
Table of Content:
Tools
promiseSleep()
Sleep some milliseconds and resolve promise
Parameters:
Name | Data type | Argument | Default value | Description |
---|---|---|---|---|
ms | number |
Returns: Promise<void>
Examples:
promiseSleep(500).then(() => tryAgainSomeMethod());
// or
async function fakeSubmit() {
await promiseSleep(300);
return true;
}
Contributing
Please fill free to create issues or send PR