♻️ Refactor icons dashboard page.

This commit is contained in:
Andrey Antukh 2019-08-06 09:06:07 +02:00
parent c948082e0a
commit c9e88cfdb7
9 changed files with 326 additions and 334 deletions

View file

@ -2,7 +2,7 @@
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2016-2017 Andrey Antukh <niwi@niwi.nz>
;; Copyright (c) 2016-2019 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.util.timers
(:require [beicon.core :as rx]))
@ -20,3 +20,10 @@
(reify rx/ICancellable
(-cancel [_]
(js/clearInterval sem)))))
(defn schedule-on-idle
[func]
(let [sem (js/requestIdleCallback #(func))]
(reify rx/ICancellable
(-cancel [_]
(js/cancelIdleCallback sem)))))