-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: break up inventory data (#1351)
Before the different pages were all grouped together. For example weaponsInventory was a single object in the state. This meant if one item changed all 4 pages were updated. The new system breaks the pages to each character (guardians and vault). It then does an eqaulity check to ensure only characters with changed data are updated. Previously transfers could cause the UI to update and take up to 1 second to redraw everything. It seems the largest updates are now 250ms.
- Loading branch information
1 parent
55769d8
commit 20a0a5b
Showing
10 changed files
with
71 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { InventoryPageEnums } from "@/app/inventory/Common.ts"; | ||
import InventoryPage from "@/app/screens/InventoryPage.tsx"; | ||
import { useGGStore } from "@/app/store/GGStore.ts"; | ||
|
||
export default function ArmorPage() { | ||
const armorPageData = useGGStore((state) => state.armorPageData); | ||
return <InventoryPage inventoryPageData={armorPageData} />; | ||
return <InventoryPage inventoryPages={InventoryPageEnums.Armor} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import InventoryPage from "@/app/screens/InventoryPage.tsx"; | ||
import { useGGStore } from "@/app/store/GGStore.ts"; | ||
import { InventoryPageEnums } from "@/app/inventory/Common.ts"; | ||
|
||
export default function GeneralPage() { | ||
const generalPageData = useGGStore((state) => state.generalPageData); | ||
return <InventoryPage inventoryPageData={generalPageData} />; | ||
return <InventoryPage inventoryPages={InventoryPageEnums.General} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import { InventoryPageEnums } from "@/app/inventory/Common.ts"; | ||
import InventoryPage from "@/app/screens/InventoryPage.tsx"; | ||
import { useGGStore } from "@/app/store/GGStore.ts"; | ||
|
||
export default function WeaponsPage() { | ||
const weaponsPageData = useGGStore((state) => state.weaponsPageData); | ||
return <InventoryPage inventoryPageData={weaponsPageData} />; | ||
return <InventoryPage inventoryPages={InventoryPageEnums.Weapons} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters