Skip to content

Commit

Permalink
fix: setImmediate and setTimeout issues (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan authored Mar 25, 2022
1 parent 886a634 commit 3e62fbe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ var enqueuePostPromiseJob =
process.nextTick(fn);
});
} :
setImmediate || setTimeout;
typeof setImmediate === 'function' ? function (fn) {
setImmediate(fn);
} : function (fn) {
setTimeout(fn);
};

// Private: cached resolved Promise instance
var resolvedPromise;
Expand Down

0 comments on commit 3e62fbe

Please sign in to comment.