Returns a promise resolved in the next event loop - think
setImmediate()
Promises are by default resolved in a microtask (current event loop).
$ npm install p-immediate
import pImmediate from 'p-immediate';
await pImmediate();
// Executed in the next event loop
console.log('🦄');
- delay - Delay a promise a specified amount of time
- p-min-delay - Delay a promise a minimum amount of time
- p-timeout - Timeout a promise after a specified amount of time
- More…