$ cnpm install set-immediate-shim
Simple
setImmediateponyfill
The shim uses the native setImmediate when available (Node.js), falls back to MessageChannel for better performance in environments that support it (modern browsers, Deno), and uses setTimeout with zero delay as a last resort.
npm install set-immediate-shim
import setImmediateShim from 'set-immediate-shim';
setImmediateShim(() => {
console.log('2');
});
console.log('1');
//=> 1
//=> 2
setImmediate()Copyright 2013 - present © cnpmjs.org | Home |