6.1.0 • Published 3 years ago
@wezom/toolkit-promise v6.1.0
@wezom/toolkit-promise
Useful tools for working with Promises
Statements | Branches | Functions | Lines |
---|---|---|---|
Table of Content:
Tools
promiseSleep()
comment: <> (AUTODOC-TOOL-START::sleep#default)
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;
}
comment: <> (AUTODOC-TOOL-END)
Contributing
Please fill free to create issues or send PR