This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-20
Channels
- # beginners (7)
- # boot (39)
- # braid-chat (3)
- # braveandtrue (1)
- # cider (27)
- # cljsjs (15)
- # cljsrn (6)
- # clojars (18)
- # clojure (307)
- # clojure-art (1)
- # clojure-brasil (1)
- # clojure-italy (2)
- # clojure-poland (3)
- # clojure-russia (61)
- # clojure-sdn (2)
- # clojure-taiwan (4)
- # clojure-uk (5)
- # clojurebridge (7)
- # clojurescript (19)
- # core-async (1)
- # core-matrix (1)
- # cursive (35)
- # datomic (3)
- # emacs (51)
- # euroclojure (3)
- # hoplon (20)
- # jobs (1)
- # keechma (1)
- # mount (3)
- # off-topic (2)
- # om (177)
- # onyx (96)
- # parinfer (4)
- # pedestal (4)
- # re-frame (19)
- # reagent (7)
- # untangled (5)
good morning. in a form-3 component, is :reagent-render
the only thing that can subscribe to get changed data? or can any of the lifecycle methods subscribe for data? (i'm sure this belies not yet understanding the whole model)
and if so, is it the job of the render to set the data somewhere on this.state
(so to speak), expecting the other lifecycle functions to read the data of the component state?
after more reading, i added a local ratom - when render is rerun, it updates the local "state", and the lifecycle functions can pull the new data off of them - am i in the ballpark? (let [some (local but shared state)
from the wiki for creating reagent components
I mean, that's_one_ way to go... You could also use a subscribe instead of the ratom, you can deref it in the lifecycle methods too
that's why i was asking about subscriptions in the lifecycle functions - i can catch the change in the render function, but then to kinda "pass it off" to those other functions, i wasn't sure how to get it from render to update, for instance
if i didn't have to use the subscription in render only, i could skip that step, and just use the subscribed data in the did-mount and did-update
Oh I see. One way to accomplish this, is to have an outer and inner component. The outer has the subscribe and passes the deref'ed values to the inner component, as props, so the inner component will update every time the subscription yields new values