wait-please
v3.1.0
Published
Assorted waiters
Downloads
162
Maintainers
Readme
wait-please
Create a promise, waiting for the indicated interval. Useful for organizing tests.
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()