This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-07
Channels
- # aws (2)
- # bangalore-clj (4)
- # beginners (62)
- # boot (74)
- # cider (408)
- # cljsrn (17)
- # clojure (117)
- # clojure-dusseldorf (1)
- # clojure-russia (21)
- # clojure-spec (17)
- # clojure-uk (15)
- # clojurescript (154)
- # cursive (3)
- # datomic (16)
- # emacs (33)
- # funcool (3)
- # hoplon (99)
- # off-topic (7)
- # om (10)
- # overtone (3)
- # portland-or (1)
- # protorepl (9)
- # re-frame (83)
- # reagent (11)
- # remote-jobs (1)
- # ring-swagger (24)
- # specter (10)
- # untangled (1)
- # yada (11)
there is, but why?
I see it can be done via (defn top-component [] [sub-component my-ratom])
and wonder whether the top-component
is necessary in this case.
@dottedmag something like this?
(defn top-component
[data-ratom]
[:p (pr-str @data-ratom)])
; render == render-component
(r/render [top-component my-data-ratom] (.getElementById js/document "root"))
Ah, so render
accepts not only a component, but also a vector of component and arguments. Thanks!
consider that it's pretty convenient to have direct access to the ratom, rather than threading it through every component
the only reason I can think of to make it an explicit parameter is unit testing