This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-31
Channels
- # adventofcode (4)
- # ai (1)
- # announcements (13)
- # babashka (1)
- # beginners (42)
- # calva (15)
- # chlorine-clover (28)
- # cider (7)
- # cljsrn (1)
- # clojure (3)
- # clojure-china (1)
- # clojure-dev (4)
- # clojure-europe (7)
- # clojure-losangeles (1)
- # clojure-nl (3)
- # clojure-nlp (2)
- # clojure-sweden (12)
- # clojure-uk (2)
- # clojurescript (30)
- # code-reviews (36)
- # core-async (5)
- # cursive (10)
- # data-science (1)
- # datalevin (1)
- # fulcro (11)
- # introduce-yourself (1)
- # lsp (10)
- # malli (7)
- # minecraft (24)
- # missionary (10)
- # monads (6)
- # nrepl (4)
- # off-topic (11)
- # portal (4)
- # rdf (1)
- # reagent (3)
- # releases (4)
- # shadow-cljs (4)
- # spacemacs (4)
Hey!
What's the difference between reagent.ratom/run!
and reagent.core/track!
? I want to save my app-db r/atom to localStorage whenever my app-db changes. I saw https://github.com/reagent-project/reagent/blob/master/doc/ManagingState.md#the-track-function-1 for track! that sound like what I want but I don't like that I have to define two things (seems cumbersome) and it didn't seem to work reliably (that may be because I was trying it with an anonymous function). Then I https://www.mail-archive.com/[email protected]/msg00087.html run! and that seems nice and easy. It seems to work now. Will it continue to do what I want? What's the difference? They both make a reaction with auto-run set to true. That's as much as I can understand from looking at the source.
Thanks!
track!
identity keeps the reaction same if used inside a Reactive context, like component render fn body.
If you had run!
in render fn, it would start new one each render.
Ok, thank you! I think I understand. It sounds like run!
will work perfectly for how I'm using it.
track!
identity keeps the reaction same if used inside a Reactive context, like component render fn body.
If you had run!
in render fn, it would start new one each render.