An isomorphic setImmediate implementation that doesn't prevent the process from exiting naturally.
npm install immediatoAn isomorphic setImmediate implementation that doesn't prevent the process from exiting naturally.
This implementation requires the MessageChannel API, so it works the same everywhere, and the implementation is tiny.
``sh`
npm install immediato
`ts
import {setImmediate, clearImmediate} from 'immediato';
// Let's scheduling a function for execution
const immediateId = setImmediate ( () => {
// Do something...
});
// Let's cancel a scheduled function
clearImmediate ( immediateId );
``
MIT © Fabio Spampinato