1.0.2 • Published 2 years ago

tiny-set-immediate v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

tiny-set-immediate

A minimal polyfill of setImmediate, for modern browsers using window.postMessage, and MessageChannel in workers.

If the native functions are available they will be returned instead of a polyfill.

import { setImmediate, clearImmediate } from 'tiny-set-immediate';

const handle = setImmediate(
  (...args) => {
    console.log(args);
  },
  [1, 2],
);

clearImmediate(handle);

This implementation does not allow string callbacks, and will not eval it.