Fork me on GitHub
#re-frame
<
2016-03-29
>
tom02:03:44

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?

tom02:03:43

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?

nberger03:03:14

@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

nberger03:03:48

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]))

josh.freckleton16:03:47

@nberger: this is a huge help! Thanks so much Nicolás!

vikeri17:03:57

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-instatements in the reaction inside the sub?

mikethompson20:03:55

@vikeri: both approaches are going to be fast enough.

mikethompson21:03:12

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)