🐛 Fix problem with Safari and render frames

This commit is contained in:
alonso.torres 2021-05-24 12:30:28 +02:00 committed by Andrés Moya
parent 28c5fd4583
commit 651230d40f
4 changed files with 28 additions and 18 deletions

View file

@ -34,12 +34,13 @@
(-dispose [_]
(js/clearInterval sem)))))
(if (and (exists? js/window) (.-requestIdleCallback js/window))
(if (and (exists? js/window)
(.-requestIdleCallback js/window))
(do
(def ^:private request-idle-callback #(js/requestIdleCallback %))
(def ^:private cancel-idle-callback #(js/cancelIdleCallback %)))
(do
(def ^:private request-idle-callback #(js/setTimeout % 100))
(def ^:private request-idle-callback #(js/setTimeout % 250))
(def ^:private cancel-idle-callback #(js/clearTimeout %))))
(defn schedule-on-idle