Simple
setImmediate
ponyfill
Note: This shim is quite inefficient, see #4
.
$ npm install set-immediate-shim
const setImmediateShim = require('set-immediate-shim');
setImmediateShim(() => {
console.log('2');
});
console.log('1');
//=> 1
//=> 2
- p-immediate - Returns a promise resolved in the next event loop - think
setImmediate()
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.