This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-09
Channels
- # announcements (3)
- # babashka (17)
- # beginners (75)
- # calva (43)
- # cider (1)
- # clj-kondo (54)
- # cljdoc (8)
- # cljs-dev (70)
- # clojure (83)
- # clojure-europe (27)
- # clojure-nl (4)
- # clojure-norway (4)
- # clojure-spec (8)
- # clojure-uk (13)
- # clojured (2)
- # clojurescript (47)
- # community-development (4)
- # conjure (2)
- # cursive (3)
- # datomic (5)
- # emacs (5)
- # events (3)
- # fulcro (13)
- # graalvm-mobile (19)
- # helix (2)
- # introduce-yourself (1)
- # jobs (2)
- # jobs-discuss (28)
- # kaocha (9)
- # livestream (11)
- # malli (15)
- # meander (24)
- # nextjournal (8)
- # off-topic (26)
- # pathom (1)
- # pedestal (8)
- # polylith (2)
- # portal (31)
- # re-frame (4)
- # reagent (10)
- # reitit (8)
- # remote-jobs (3)
- # sci (1)
- # shadow-cljs (66)
- # spacemacs (20)
- # testing (6)
- # vim (15)
- # xtdb (7)
Hi! How can it be that when my form 2 component depends on ratom it got rerendered, but when it depends on ratom/make-reaction (I need it's :on-dispose feature) component does not rerendered...cant figure it out.
Shouldn't be the case. In the form-2 component, do you deref them in the inner function or the outer one?
minimal example when i use make-some-state - low-level-component got rerendered but with make-some-state* - is not
The picture is not yet complete.
The code has nothing that should lead to a re-render - do you change the value of reg-state
anywhere?
BTW not important, but that doall
is not needed.
This example also doesn't seem to be that minimal - it has an extra atom and a ratom that don't seem to be important at all. It also switches between JS and CLJS data structures. Or can you not reproduce the behavior if you remove any or those things?
yeah, ret-state got updates from external JS lib firebase-like, ret-state takes new values from server ( db ) p.s. irl its more complex and doall is needed,
rerenderindg triggers by swaping\reseting the ret-state
from external handler which got updates from that JS db
But it only matters that in the first case (subscribing directly to ratom) everything works, but in the second case (with make-reaction) it does not.
I know that I can use r/with-let in component and use (finally) but it entails some boilerplate