/set-immediate-shim

Simple `setImmediate` shim

Primary LanguageJavaScriptMIT LicenseMIT

set-immediate-shim

Simple setImmediate ponyfill

Note: This shim is quite inefficient, see #4.

Install

$ npm install set-immediate-shim

Usage

const setImmediateShim = require('set-immediate-shim');

setImmediateShim(() => {
	console.log('2');
});

console.log('1');

//=> 1
//=> 2

Related

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