Package Exports
- set-immediate
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (set-immediate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
setImmediate
A simple and lightweight shim for the setImmediate W3C Draft API, for use in any browsers and NodeJS.
Example usage
You can include the script any way you want in a browser, in NodeJS environment, it is suggested that you do so by installing set-immediate
from npm, and then including it using require('set-immediate')
, preferably before any other dependencies, so that they can use it too (it is injected on the global object for browser < - > node compatibility).
setImmediate(function (foo, bar) {
console.log(foo, bar);
}, ['foo', 'bar']);
var id = setImmediate(function () {});
clearImmediate(id);