waait
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

build status

Waait

Hold on a sec, or 7.

wait() Returns a promise that resolves after how many milliseconds you pass it.

Great for waiting any amount of time. If you do not pass it any value, it will immediately resolve. This is handy when you need to ensure the following code is put at the end of the JS event callstack.

Usage

import wait from 'waait';
 
async function doStuff() {
  doSomething();
  await wait();
  doSomethingElse();
  await wait(200);
  console.log('200ms later');
}
 

Readme

Keywords

none

Package Sidebar

Install

npm i waait

Weekly Downloads

103,766

Version

1.0.5

License

MIT

Unpacked Size

2.66 kB

Total Files

7

Last publish

Collaborators

  • wesbos