3 function shim(callback) {
4 return window.setTimeout(callback, 1000 / 60);
7 function shimCancel(timeoutId) {
8 window.clearTimeout(timeoutId);
13 if (typeof window !== 'undefined') {
15 window.requestAnimationFrame ||
16 window.webkitRequestAnimationFrame ||
17 window.mozRequestAnimationFrame;
20 window.cancelAnimationFrame ||
21 window.webkitCancelAnimationFrame ||
22 window.mozCancelAnimationFrame;
25 module.exports = (nativeRaf && nativeRaf.bind(window)) || shim;
26 module.exports.cancel = (nativeCancel && nativeCancel.bind(window)) || shimCancel;