Universal process.nextTick for latest browsers
$ npm install proc-nexttick
const nextTick = require('proc-nexttick')
nextTick((arg1, arg2) => {
console.log('executed in the next tick', arg1, arg2)
}, 0, 1)
In Node.js it will use the native process.nextTick
without changes.
In the browser:
- It tries to use
queueMicrotask
. - Fallback to use a
process
shim implementation provided by some bundler tool like browserify or webpack. - Fallback to use Promises.
🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.
👥 Ideas and contributions to the project are welcome. You must follow this guideline.
MIT ©