This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-07
Channels
- # announcements (1)
- # babashka (79)
- # beginners (177)
- # cider (27)
- # cljdoc (24)
- # cljs-dev (4)
- # clojure (43)
- # clojure-norway (7)
- # clojure-uk (3)
- # clojurescript (52)
- # conjure (12)
- # cryogen (1)
- # cursive (5)
- # data-science (7)
- # datahike (1)
- # datomic (1)
- # dirac (2)
- # helix (14)
- # jobs-discuss (130)
- # juxt (4)
- # liberator (4)
- # malli (2)
- # mxnet (2)
- # news-and-articles (1)
- # nrepl (19)
- # off-topic (27)
- # pathom (3)
- # practicalli (1)
- # re-frame (4)
- # reagent (2)
- # ring (7)
- # shadow-cljs (21)
- # spacemacs (11)
- # vim (38)
- # xml (2)
- # xtdb (17)
I'm doing something like (rf/dispatch [:set-foo (js/setInterval #(bar) 1000)])
to both start an interval and save the id for clearing later. it feels a little dirty to me, I was just wondering if there's a more idiomatic way to do this
IMO a more idiomatic way would be create an effect handler that calls setInterval
for you. Along with the effect handler there would be a map of some ID that you pass to the effect to the value returned by setInterval
. That's exactly what :dispatch-debounce
effect handler in re-frame-fx
does: https://github.com/7theta/re-frame-fx/blob/master/src/re_frame_fx/dispatch.cljs#L16