3 Object.defineProperty(exports, "__esModule", {
7 var _setImmediate = require('./internal/setImmediate');
10 * Calls `callback` on a later loop around the event loop. In Node.js this just
11 * calls `setImmediate`. In the browser it will use `setImmediate` if
12 * available, otherwise `setTimeout(callback, 0)`, which means other higher
13 * priority events may precede the execution of `callback`.
15 * This is used internally for browser-compatibility purposes.
19 * @memberOf module:Utils
23 * @param {Function} callback - The function to call on a later loop around
24 * the event loop. Invoked with (args...).
25 * @param {...*} args... - any number of additional arguments to pass to the
26 * callback on the next tick.
29 * var call_order = [];
30 * async.nextTick(function() {
31 * call_order.push('two');
32 * // call_order now equals ['one','two']
34 * call_order.push('one');
36 * async.setImmediate(function (a, b, c) {
37 * // a, b, and c equal 1, 2, and 3
42 if (_setImmediate.hasNextTick) {
43 _defer = process.nextTick;
44 } else if (_setImmediate.hasSetImmediate) {
45 _defer = setImmediate;
47 _defer = _setImmediate.fallback;
50 exports.default = (0, _setImmediate.wrap)(_defer);
51 module.exports = exports['default'];