tiny-set-immediate
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i tiny-set-immediate

Weekly Downloads

9,822

Version

1.0.2

License

MIT

Unpacked Size

6.54 kB

Total Files

7

Last publish

Collaborators

  • monastic.panic