Open brian-gates opened 2 years ago
Problem: full copies of items exist everywhere. Reduce the size and redundancy of state by normalizing items within the character slice.
items
itemCreated
itemDestroyed
statsModified
itemEquipped
itemRemoved
Success criteria: No Items in the character slice, only ids. No change in behavior.
Item
https://redux.js.org/usage/structuring-reducers/updating-normalized-data
Alternative for consideration: inventory slice.
inventory
Problem: full copies of items exist everywhere. Reduce the size and redundancy of state by normalizing items within the character slice.
items
sliceitemCreated
actionitemCreated
action whenever an item is added to the gameitemDestroyed
action whenever an is removed from the gamestatsModified
in character slice onitemEquipped
anditemRemoved
(instead of within the selector)items
sliceSuccess criteria: No
Item
s in the character slice, only ids. No change in behavior.https://redux.js.org/usage/structuring-reducers/updating-normalized-data
Alternative for consideration:
inventory
slice.