Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Switch to Redux? #155

Description

@artlowel

I think we should consider using Redux to manage the state in the new UI.

  • What is it?
    • It is basically a set of design-patterns
    • The entire application state is kept in a single tree
    • This tree is immutable, if the state is changed a new tree is generated
    • There is a limited set of actions that define all the reasons why the state can be changed
    • Changing the state happens through reducers: functions take in an action, know what needs to be done in response to that action and return a new copy of the state tree
    • Other parts of the application can subscribe to a variable in the store to automatically update when it changes
  • Why
    • easier to reason about
      • The store is the cannonical truth
    • easier to write tests for
    • faster: you can use the more efficient OnPush ChangeDetectionStrategy
    • components become a lot lighter as logic moves to reducers
    • It could allow us to continue on the client where the server left off, by initializing the client with the server's store.
  • Links

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions