Improve rAF function

This commit is contained in:
SleepWalker 2016-08-22 07:28:05 +03:00
parent 9536e89fba
commit 40def86590

View File

@ -41,5 +41,8 @@ export function loadScript(src) {
});
}
export const rAF = window.requestAnimationFrame || window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
export const rAF = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| ((cb) => setTimeout(cb, 1000 / 60));