This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-29
Channels
- # beginners (14)
- # boot (83)
- # cider (13)
- # cljsrn (4)
- # clojure (240)
- # clojure-argentina (1)
- # clojure-berlin (2)
- # clojure-canada (1)
- # clojure-dusseldorf (1)
- # clojure-greece (2)
- # clojure-india (2)
- # clojure-japan (2)
- # clojure-russia (23)
- # clojure-taiwan (2)
- # clojure-uk (12)
- # clojurescript (138)
- # cursive (6)
- # datomic (36)
- # hoplon (245)
- # jobs-discuss (35)
- # lein-figwheel (4)
- # melbourne (2)
- # off-topic (1)
- # om (26)
- # om-next (2)
- # onyx (23)
- # proton (8)
- # quil (1)
- # re-frame (9)
- # ring-swagger (2)
- # untangled (10)
- # yada (6)
One more question. If I have a simple but big CRUD program I want to write, and a lot of different panels/views, do I need to go fully with this if I'll have lots of handlers and subs and views? https://github.com/Day8/re-frame/wiki/A-Larger-App OR, suppose I'll just have lots of components, can I just split up components into a views.* namespace somewhere require those? Is there a good was to structure that sort of thing?
And if I do go with the "A Larger App" way, does anyone know of any examples of how to put that together? A core file that has to require each of the namespaces for each panel?
@josh.freckleton: if re-com intimidated you (it takes care of many things!), here's what I think is a simplified version of that internal/external pattern: http://cljsfiddle.nberger.com.ar/#gist=096d229ecd7237f2a547
(here's just the gist: https://gist.github.com/anonymous/096d229ecd7237f2a547)
the only difference with your scenario is that search-term would probably be something like subscribe [:password]
and the on-change (the second arg) would be something like (fn [v] (dispatch [:update-login-form :password v]))
@nberger: this is a huge help! Thanks so much Nicolás!
A question about performance: I have a relational setup in my db. For example I have one entry that is :current-item
which is an integer with the item id. To access the item I look that value up in the map :items
. Should i put two subscriptions in my component, one to get current item (id) and then call the next subscription to get the item itself with that id or should I just nest get-in
statements in the reaction inside the sub?
@vikeri: both approaches are going to be fast enough.
For the 1st approach, you might need to use dynamic subscriptions (the subscription to the item will change when the subscription to :current-item
changes)