Need private packages and team management tools?Check out npm Teams »

p-immediate

3.1.0 • Public • Published

p-immediate Build Status

Returns a promise resolved in the next event loop - think setImmediate()

Promises are by default resolved in a microtask (current event loop).

Install

$ npm install p-immediate

Usage

const pImmediate = require('p-immediate');
 
(async () => {
    await pImmediate();
 
    // Executed in the next event loop
    console.log('🦄');
})();

Related

  • 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…

License

MIT © Sindre Sorhus

Install

npm i p-immediate

DownloadsWeekly Downloads

300

Version

3.1.0

License

MIT

Unpacked Size

3.73 kB

Total Files

5

Last publish

Collaborators

  • avatar