Hi! I'm following the exercises in the guide, and right now I'm at the "putting it together" part
I uncorrectly assumed from the mutations chapter that by using uc/integrate-ident!
I wouldn't have needed to manually add my e.g. new todo both to :todos/by-id
and to :list/todos
, but in the exercise solution the mutation still has to perform both operations. So, my question is: what's the difference between this (uc/integrate-ident! state new-ident :append [:lists/by-title list :list/items])
and something like this (swap! state update-in [:lists/by-title list :list/items] #(vec (cons new-ident %)))
?
And then my followup question is: why doesn't uc/integrate-ident!
automatically add the todo to :todos/by-id
?
Integrate ident is what you said with a few error checks and the ability to do more than one at a time. Just a simplification. Merge is needed to normalize the item itself, so that is a separate (often automatic) step done during net response processing.
Mmm I see! It's a lot to learn and some concepts are very new to me 🙂
Should I move to the cookbook after the devguide?
The main concepts really are the database format and normalization. Of course, understanding react doesn't hurt. If you get through the entire DevGuide, you're probably in pretty good shape to write an application, and the cookbook will just help you with examples. The getting started video series, and the new untangled in the large video series I'm doing on YouTube are also probably helpful.
I'm pretty familiar with react, but I'm a little lost on queries. And also having to put everything together, I think I'm not grasping the full picture yet, there's a lot going on 🙂
I know it feels that way at first, but once you're more familiar with it you'll see there's actually very little going on. That's the beauty of it. The simplifications lead to higher level concepts, but many fewer of them. You might try the getting started videos now rather than later. Seeing it in dynamic action is sometimes helpful.
Ok, I'll give them a try! Thanks 🙂
Welcome