This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-15
Channels
- # adventofcode (6)
- # beginners (63)
- # boot (39)
- # cider (25)
- # clara (9)
- # cljs-dev (27)
- # clojure (100)
- # clojure-dev (39)
- # clojure-dusseldorf (7)
- # clojure-italy (32)
- # clojure-russia (23)
- # clojure-spec (28)
- # clojure-uk (51)
- # clojurescript (197)
- # core-async (44)
- # cursive (3)
- # datomic (14)
- # emacs (4)
- # fulcro (27)
- # graphql (23)
- # hoplon (4)
- # jobs (9)
- # juxt (1)
- # leiningen (3)
- # nyc (1)
- # off-topic (6)
- # om (7)
- # onyx (6)
- # parinfer (11)
- # re-frame (23)
- # reagent (15)
- # ring-swagger (1)
- # rum (15)
- # shadow-cljs (37)
- # sql (24)
- # uncomplicate (4)
- # unrepl (17)
@gadfly361 awesome! this is great enough. thanks! 😄
@gadfly361 wow, I actually tried the demo of it and it's really good :thumbsup:
i'm hitting a rather interesting architectural challenge with reagent. is there a way to access state in an ratom without wanting it to perform a re-run of the function (in this case, one that is tracked). For example, I track a function that I want to run when one piece of state changes, but that function, when it runs, also needs access to another piece of state -- but if I access that second item, that will also cause the entire function to run again when that second piece of state changes, even though I only want the function triggered when the first piece changes. In other words, is there a way to simply read the contents of an ratom without the reader getting registered for a re-render/re-track?
@ajs I know there is an internal _peek
operator on atoms that does what you want https://github.com/reagent-project/reagent/blob/27be89297cee1034b45800a7b6811b530e51b59e/src/reagent/ratom.cljs#L255
@ajs there is deref-or-value-peek
in re-com https://github.com/Day8/re-com/blob/3cc095d2ca6768e15b45040c3b9645945f5c68b4/src/re_com/util.cljs#L33-L56
However unless you're building a debugging tool, I would think more about how to reformulate the problem
Why do you want to only rerun on the first piece of data change, but not the second?
indeed, it's more of an architectural problem. i think the problem is I'm relying on Reagent for matters that not related to UI specifically, so I'll refactor that out separately.
i was using app state sort of like a message channel to avoid circular dependencies which can quite easily happen. in the past i used core.async with great effect for things like this and think i'll head back in that direction