dezorse
v1.0.0
Published
Like dezalgo but let you choose your "asap" function.
Downloads
4
Readme
dezorse
Like dezalgo but let you choose your "asap" function. If you're writing for Node.js only or need very high throughput, just use dezalgo.
dezorse defaults to setTimeout which is available everywhere.
Getting started
npm install dezorse
var dezorse = require('dezorse');
or
<script src="node_modules/dezorse/index.js"></script>
var dezorse = window.dezorse
Usage
// maybe you don't care for performances ?
dezorse(fn) // will use setTimeout
// maybe you need to yield for IO/reflow/repaint ?
// https://github.com/YuzuJS/setImmediate
dezorse(fn, setImmediate)
// maybe you just need Node.js support ? (bad example, use dezalgo)
dezorse(fn, process.nextTick)
// maybe you already have a Promise polyfill or only target platforms with Promise support ?
dezorse(fn, function () {
Promise.resolve().then(fn)
})
Test
npm install standard
npm test