This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-27
Channels
- # aleph (7)
- # beginners (80)
- # boot (1)
- # cider (3)
- # cljs-dev (277)
- # cljsjs (52)
- # cljsrn (1)
- # clojure (69)
- # clojure-gamedev (4)
- # clojure-italy (1)
- # clojure-losangeles (2)
- # clojure-russia (89)
- # clojure-spec (92)
- # clojure-uk (196)
- # clojured (1)
- # clojurescript (70)
- # cursive (5)
- # data-science (1)
- # datascript (84)
- # datomic (9)
- # defnpodcast (12)
- # docker (1)
- # emacs (4)
- # events (1)
- # fulcro (112)
- # graphql (1)
- # jobs (1)
- # lumo (1)
- # nrepl (21)
- # off-topic (2)
- # onyx (3)
- # protorepl (10)
- # re-frame (23)
- # reagent (66)
- # reitit (2)
- # rum (13)
- # shadow-cljs (144)
- # spacemacs (14)
- # sql (4)
- # unrepl (29)
- # vim (16)
@amarjeet looks like you are fetching data, storing it in the state, component re-renders and fetching runs again and so on
@roman01la so, when the fetching re-runs, the local-state atom's value doesn't change. And, if the value doesn't change, the the App component's rendering should stop - thats my understanding of rum/reactive mixin
the local-state atom's value doesn't change because the fetch process fetches the same data
@amarjeet AFAIK, reactive
mixin doesn’t check if the state has changed
no, it has subscribed to the local-state
atom. So, for the 1st fetch, the value of local-state
atom changes, and triggers the App render. But for the 2nd time, its value doesn't change, but assoc process does happen
So, it seems that as long as local-state
gets the assoc
operation (even though the final value doesn't change), the App component will render
every time you swap!
the atom, it triggers watcher function here https://github.com/tonsky/rum/blob/gh-pages/src/rum/core.cljs#L325 which re-renders the component
thanks much @roman01la for this