You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operations like "Look up all books by this author", can then be accomplished easily with a single loop over the join table.
If I understood well, the goal is to loop over authorBook keys to save all bookIds where authorId is the one we want.
I struggle to understand how it is better than retrieving bookIds directly with authors.byId[id].books?
However, if we didn't want to store bookIds inside the author schema, we could have used a look up table like this one:
There are probably a number of different ways that you could store the key associations, and I was trying to avoid saying "you must do it $SPECIFIC_WAY". Instead, I was trying to offer some suggestions to get people thinking in certain directions.
First of all, I love the new documentation, last time I checked it was years ago and was way more confusing.
What docs page needs to be fixed?
Using Redux > Redux logic and patterns > Structuring reducers > Nomalizing State Shape:
https://redux.js.org/usage/structuring-reducers/normalizing-state-shape#relationships-and-tables
What is the problem?
From the documentation, we have this given code:
It is stated:
If I understood well, the goal is to loop over
authorBook
keys to save allbookId
s whereauthorId
is the one we want.I struggle to understand how it is better than retrieving
bookId
s directly withauthors.byId[id].books
?However, if we didn't want to store
bookId
s inside theauthor
schema, we could have used a look up table like this one:Wouldn't it make more sense?
I asked my backend team and they were also confused about it.
It would be really appreciated if someone could enlighten us.
What should be changed to fix the problem?
If we couldn't understand it, maybe it's a sign it needs to be more explicit (e.g. more/better examples).
The text was updated successfully, but these errors were encountered: