Adventure-Bot / Adventure-Bot/adventure-bot

Normalized items

Aperta
#9 0 commenti 0 reazioni 1 assegnatario Rivendicata da @brian-gates Vedi su GitHub
Lingua principale
TypeScript
Stelle
7
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Problem: full copies of items exist everywhere. Reduce the size and redundancy of state by normalizing items within the character slice.

- [x] create `items` slice
- [x] create `itemCreated` action
- [x] dispatch `itemCreated` action whenever an item is added to the game
- [x] dispatch `itemDestroyed` action whenever an is removed from the game
- [ ] reduce `statsModified` in character slice on `itemEquipped` and `itemRemoved` (instead of within the selector)
- [ ] migrate character inventory and equipment to reference `items` slice
- [ ] update selectors to denormalize back to original shape

Success 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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.