smart-next-tick
v1.1.0
Published
Another environment agnostic nextTick polyfill
Downloads
381
Maintainers
Readme
smart-next-tick
Another environment agnostic nextTick polyfill
To be used in environment agnostic modules that need nextTick functionality.
- When run in Node.js
process.nextTick
is used - In modern browsers microtask resolution is guaranteed by
MutationObserver
[92.74%] - In other engines
setTimeout(fn)
is used as fallback
Installation
npm install --save smart-next-tick
Syntax
nextTick(func[, context, param1, param2, ...])
func
A function to be executed.
context [Optional]
The context to be bound by func
.
param1, param2, ..., paramN [Optional]
Additional parameters which are passed through to func
.