Forked from WebReflection/process.nextTick.js
Last active
September 15, 2015 02:05
-
-
Save silverbux/db678586c45a667c10b7 to your computer and use it in GitHub Desktop.
process.nextTick(callback) for browsers too
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function (window) {"use strict"; | |
// by WebReflection - WTFPL License | |
var | |
prefixes = "r webkitR mozR msR oR".split(" "), | |
process = "process", | |
nextTick = "nextTick", | |
i = 0, | |
p = window[process] || (window[process] = {}) | |
; | |
while (!p[nextTick] && i < prefixes.length) | |
p[nextTick] = window[prefixes[i++] + "equestAnimationFrame"] | |
; | |
p[nextTick] || (p[nextTick] = window.setImmediate || window.setTimeout); | |
}(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment