0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-16 08:51:32 -05:00

🐛 Add timeout to request on idle timers

This commit is contained in:
alonso.torres 2024-02-27 10:23:56 +01:00 committed by Andrey Antukh
parent 072c724462
commit 98e56bab80

View file

@ -43,7 +43,7 @@
(if (and (exists? js/window)
(.-requestIdleCallback js/window))
(do
(def ^:private request-idle-callback #(js/requestIdleCallback %))
(def ^:private request-idle-callback #(js/requestIdleCallback % #js {:timeout 30000})) ;; 30s timeout
(def ^:private cancel-idle-callback #(js/cancelIdleCallback %)))
(do
(def ^:private request-idle-callback #(js/setTimeout % 250))