wait-please
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/wait-please package

3.1.0 • Public • Published

wait-please Build Status unstable

Create a promise, waiting for the indicated interval. Useful for organizing tests.

NPM

import { time, frame, time, idle } from 'wait-please'
 
// 3 microtask ticks (queueMicrotask, Promise.resolve ~ same as process.nextTick)
await tick(3)
 
// 3 animation frames (requestAnimationFrame)
await frame(3)
 
// 150 ms (setTimeout)
await time(150)
 
// 1 macrotask in task queue (idle, setImmediate)
await idle()

Similar / refs

HK

Package Sidebar

Install

npm i wait-please

Weekly Downloads

45

Version

3.1.0

License

MIT

Unpacked Size

3.22 kB

Total Files

6

Last publish

Collaborators

  • dy