1.1.1 • Published 5 years ago

next-tick-2 v1.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

DEPRECATED

Avoid using next-tick-2 or next-tick. setTimeout(...) is a better alternative, and it's available everywhere.

next-tick-2

Environment agnostic nextTick polyfill

Build Status

A commonjs module that provides nextTick functionality in node and the browser.

  • When run in Node.js process.nextTick is used
  • In modern browsers microtask resolution is guaranteed by MutationObserver
  • In other engines setImmediate or setTimeout(fn, 0) is used as fallback.
  • If none of the above is supported module resolves to undefined

why next-tick-2?

The original next-tick module includes the node process module, which causes browserify to shim the module. It results in a larger bundle size, with unused code.

The original maintainer is not interested in fixing the problem. As a result the browserified code that relies on next-tick-2 is significantly (3.4X) smaller than that generated by next-tick:

-rw-r--r--  1 mike  staff  8022 May  2 11:18 bundle-next-tick.js
-rw-r--r--  1 mike  staff  2334 May  2 11:18 bundle-next-tick-2.js