Skip to content

Feature Request: Refactor frontend state management #1312

Open
@HerveH44

Description

@HerveH44

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 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions