Skip to content

Instantly share code, notes, and snippets.

@ShivrajRath
Forked from WebReflection/process.nextTick.js
Created January 19, 2014 03:53
Show Gist options
  • Save ShivrajRath/8500300 to your computer and use it in GitHub Desktop.
Save ShivrajRath/8500300 to your computer and use it in GitHub Desktop.
!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