@wezom/toolkit-promise
TypeScript icon, indicating that this package has built-in type declarations

6.1.0 • Public • Published

@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


/@wezom/toolkit-promise/

    Package Sidebar

    Install

    npm i @wezom/toolkit-promise

    Weekly Downloads

    34

    Version

    6.1.0

    License

    BSD-3-Clause

    Unpacked Size

    6.51 kB

    Total Files

    7

    Last publish

    Collaborators

    • dutchenkooleg