Fork me on GitHub
#untangled
<
2017-01-29
>
doddenino17:01:29

Hi! I'm following the exercises in the guide, and right now I'm at the "putting it together" part

doddenino17:01:10

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 %)))?

doddenino17:01:31

And then my followup question is: why doesn't uc/integrate-ident! automatically add the todo to :todos/by-id?

tony.kay18:01:36

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.

doddenino18:01:44

Mmm I see! It's a lot to learn and some concepts are very new to me 🙂

doddenino18:01:01

Should I move to the cookbook after the devguide?

tony.kay18:01:33

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.

doddenino18:01:57

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 🙂

tony.kay18:01:34

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.

doddenino18:01:13

Ok, I'll give them a try! Thanks 🙂