Переглянути джерело

chore: stick to mutable variable convention

Miguel Ángel Moreno 3 місяців тому
батько
коміт
4c971ab3db
1 змінених файлів з 4 додано та 4 видалено
  1. 4 4
      src/frontend/tubo/events.cljs

+ 4 - 4
src/frontend/tubo/events.cljs

@@ -121,16 +121,16 @@
  (fn [_ [_ element]]
    {:scroll-top! element}))
 
-(defonce timeouts! (r/atom {}))
+(defonce !timeouts (atom {}))
 
 (rf/reg-fx
  :timeout
  (fn [{:keys [id event time]}]
-   (when-some [existing (get @timeouts! id)]
+   (when-some [existing (get @!timeouts id)]
      (js/clearTimeout existing)
-     (swap! timeouts! dissoc id))
+     (swap! !timeouts dissoc id))
    (when (some? event)
-     (swap! timeouts! assoc
+     (swap! !timeouts assoc
        id
        (js/setTimeout #(rf/dispatch event) time)))))