Adventure-Bot / Adventure-Bot/adventure-bot

Normalized items

オープン
#9 コメント 0 件 リアクション 0 件 担当者 1 名 @brian-gates が担当を希望しています GitHub で見る
主要言語
TypeScript
スター
7
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。