Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve State Management #462

Open
steets250 opened this issue Jul 13, 2021 · 1 comment
Open

Improve State Management #462

steets250 opened this issue Jul 13, 2021 · 1 comment
Assignees
Labels
Redesign Issues being saved for the portal redesign

Comments

@steets250
Copy link
Member

The current Redux store divides state into components as follows:

admin: AdminReducer,
auth: AuthReducer,
event: EventReducer,
leaderboard: LeaderboardReducer,
profile: ProfileReducer,
store: StoreReducer,

This ends up preventing actions in a specific area from updating state in a separate area. We should look into re-organizing the state by data field, rather than exactly mirroring the folder setup. We may also want to consider if Redux is necessary, and if using useContext and useState is a better option for our use case.

@steets250 steets250 added the Redesign Issues being saved for the portal redesign label Jul 13, 2021
@StormFireFox1
Copy link
Member

We've decided to try using Redux Toolkit in order to refactor our state. We have notes on this in the board Notion, so you can read about the design choice there.

As for tasks to do, this involves taking all the boilerplate we have and moving it to effectively what RTK does (which is slices).

I've assigned Sean on this, since he's most experienced with RTK, and we can discuss the various changes in the PR he will make when we review it.

  • Create slice files for RTK for each feature folder in UI (so storeActions, storeReducerstoreSlice)
  • Compose slice file into separate RTK store
  • Move actions and reducers to RTK store one at a time(test if portal breaks with each slide adding)
    • If this proves too hard to do without breaking the other parts of portal, just move it all at once and we'll test bugs at review
  • Remove old Redux store

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Redesign Issues being saved for the portal redesign
Projects
No open projects
Status: In Progress
Development

No branches or pull requests

3 participants