From 40def86590d9cd8320f2d934be446e211af0002c Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Mon, 22 Aug 2016 07:28:05 +0300 Subject: [PATCH] Improve rAF function --- src/functions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/functions.js b/src/functions.js index 01bd108..b275fe0 100644 --- a/src/functions.js +++ b/src/functions.js @@ -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));