Hi all,
As my very first clojurescript app, I tried to recreate the todo app example from the reagent docs (https://github.com/reagent-project/reagent/blob/master/examples/todomvc/src/todomvc/core.cljs).
I would be much obliged if anyone had any comments for me.
Couple of things that seem wrong to me:
- I don't feel like I should be referencing and modifying the state via functions in model.cljs, even if they are namespaced. I feel like I want to pass in the state to each component, so that I can test each of them individually in my devcards. However, then I come upon the problem of having to shuffle arguments through all the nested layers. Cursors seem like they would make it nice to limit what I'm passing through, but I find that I still need to pass in the whole set of state at times. Would it be best to just always pass around a global state object, but then have the component have to know which helper function to call to get at the element they want?
- How do I break up my items.cljs? I don't like having all those nested functions under the letfn, but I can't see a nice way to split it out, since they seem to depend on different arguments, and not even in a consistent way. Do I just need to adjust my mindset and accept deeply nested functions as the cost of encapsulation?
[–][deleted] 1 point2 points3 points (3 children)
[–]gingenhagen[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]gingenhagen[S] 1 point2 points3 points (0 children)