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

Feature Request: Refactor frontend state management #1312

Open
HerveH44 opened this issue Dec 8, 2020 · 0 comments · May be fixed by #1326
Open

Feature Request: Refactor frontend state management #1312

HerveH44 opened this issue Dec 8, 2020 · 0 comments · May be fixed by #1326

Comments

@HerveH44
Copy link
Contributor

HerveH44 commented Dec 8, 2020

Detailed Description

State management is a mess. Few things I'd like to touch to simplify:

  1. Separate state of Game Creation (all the options, that are actually in "App.state") from State of the Game played (which is a bit everywhere, there's a start in "App.state.game".

  2. GameState is doing too many things: Simplify with one component in charge of saving the cards in one place, so we would have 3 subcomponents, each handling one place (MAIN, SIDE, JUNK). I doubt that we need to save the state of Pack as it's sent by the server at connection. We need also a component to save autopick / burn id of current pick. Then GameState could just be a HoC that just wrap all of it. It should also be renamed because it clashes with App.state, or ... merge App.state into a new subcomponent of GameState that handles game creation options. That would indicate future devs where they should put/get the data in future features.

Further Information

We could use Redux as a clean and standard way to handle state management across the app. Anybody has a better suggestion ?

@HerveH44 HerveH44 linked a pull request Dec 10, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant