Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@iocmd/wait

iocmd664MIT2.1.0

promisified setTimeout

timeout, promise, async, await

readme

Wait License NPM version Build Status Coverage Status

Promisified setTimeout

Install

npm i @iocmd/wait

Example

await wait(console.log, 'hello');
// log "hello" in next loop

await wait(1000, console.log, 'hello');
// log "hello" in a second

await wait(1000);
// wait for a second
  • hold-up - setInterval with promises, counter and error handling

  • currify - translate the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single or more arguments

  • fullstore - functional variables

  • wraptile - translate the evaluation of a function that takes multiple arguments into evaluating a sequence of 2 functions, each with a any count of arguments

License

MIT

changelog

2022.04.06, v2.1.0

feature:

  • (wait) add ability to use only number as argument

2022.04.06, v2.0.0

feature:

  • (wait) drop support of node < 16
  • (package) supertape v7.2.1
  • (package) madrun v9.0.2
  • (package) eslint-plugin-putout v14.8.0
  • (package) putout v25.14.0
  • (package) eslint v8.12.0