code: function nextTickFn() {
    // setImmediate allows to run task after already queued I/O callbacks
    if (typeof setImmediate === 'function') {
      return setImmediate;
    } else if (typeof process !== 'undefined' && process.nextTick) {
      return function(fn) {
        process.nextTick(fn);
      }
    } else {
      return function(fn) {
        setTimeout(fn, 0);
      }
    }
  }
docs: Return next tick function for current environment.