@wezom/toolkit-promise

Useful tools for working with Promises

Usage no npm install needed!

<script type="module">
  import wezomToolkitPromise from 'https://cdn.skypack.dev/@wezom/toolkit-promise';
</script>

README

@wezom/toolkit-promise

Useful tools for working with Promises

Statements Branches Functions Lines
Statements Branches Functions Lines

Table of Content:

  1. Tools
    1. promiseSleep()
  2. Contributing
  3. License

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;
}

▲ Go Top | ▲ Table of Content


Contributing

Please fill free to create issues or send PR

Licence

BSD-3-Clause License