Sha256: 91e4ffb114b4d60af8da177eb388d507a13dc9bc449f68e2d4912083cbc2b1f7

Contents?: true

Size: 441 Bytes

Versions: 102

Compression:

Stored size: 441 Bytes

Contents

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);
  }
}

Version data entries

102 entries across 89 versions & 22 rubygems

Version Path
lux_assets-0.2.11 ./node_modules/combined-stream/lib/defer.js
lux_assets-0.2.9 ./node_modules/asynckit/lib/defer.js
lux_assets-0.2.9 ./node_modules/combined-stream/lib/defer.js
lux_assets-0.2.4 ./node_modules/asynckit/lib/defer.js
lux_assets-0.2.4 ./node_modules/combined-stream/lib/defer.js
lux_assets-0.2.2 ./node_modules/asynckit/lib/defer.js
lux_assets-0.2.2 ./node_modules/combined-stream/lib/defer.js
lux_assets-0.2.1 ./node_modules/combined-stream/lib/defer.js
lux_assets-0.2.1 ./node_modules/asynckit/lib/defer.js
locomotivecms-3.4.0 app/javascript/node_modules/asynckit/lib/defer.js
locomotivecms-3.4.0 app/javascript/node_modules/combined-stream/lib/defer.js
cortex-0.1.3 spec/dummy/node_modules/asynckit/lib/defer.js
dragonfly_puppeteer-0.1.0 node_modules/asynckit/lib/defer.js
dragonfly_puppeteer-0.1.0 node_modules/combined-stream/lib/defer.js
affiliator-0.2.1 node_modules/fsevents/node_modules/asynckit/lib/defer.js
lanes-0.8.0 node_modules/asynckit/lib/defer.js
lanes-0.8.0 node_modules/fsevents/node_modules/asynckit/lib/defer.js
node-compiler-0.9.1 vendor/node/deps/npm/node_modules/request/node_modules/form-data/node_modules/asynckit/lib/defer.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/node_modules/request/node_modules/form-data/node_modules/asynckit/lib/defer.js
select_all-rails-0.3.1 node_modules/asynckit/lib/defer.js