UNPKG

388 BJavaScriptView Raw
1'use strict'
2
3if (typeof setImmediate === 'function') { // IE >= 10 & node.js >= 0.10
4 module.exports = function(fn){ setImmediate(fn) }
5} else if (typeof process !== 'undefined' && process && typeof process.nextTick === 'function') { // node.js before 0.10
6 module.exports = function(fn){ process.nextTick(fn) }
7} else {
8 module.exports = function(fn){ setTimeout(fn, 0) }
9}