module.exports = defer;
/**
* Runs provided function on next iteration of the event loop
*
* @param {function} fn - function to run
*/
function defer(fn)
{
var nextTick = typeof setImmediate == 'function'
? setImmediate
: (
typeof process == 'object' && typeof process.nextTick == 'function'
? process.nextTick
: null
);
if (nextTick)
{
nextTick(fn);
}
else
{
setTimeout(fn, 0);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| abort.js | File | 497 B | 0644 |
|
| async.js | File | 599 B | 0644 |
|
| defer.js | File | 441 B | 0644 |
|
| iterate.js | File | 1.75 KB | 0644 |
|
| readable_asynckit.js | File | 1.57 KB | 0644 |
|
| readable_parallel.js | File | 673 B | 0644 |
|
| readable_serial.js | File | 655 B | 0644 |
|
| readable_serial_ordered.js | File | 941 B | 0644 |
|
| state.js | File | 941 B | 0644 |
|
| streamify.js | File | 2.89 KB | 0644 |
|
| terminator.js | File | 533 B | 0644 |
|