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

Switch to Redux? #155

Open
artlowel opened this issue Jun 30, 2016 · 0 comments
Open

Switch to Redux? #155

artlowel opened this issue Jun 30, 2016 · 0 comments

Comments

@artlowel
Copy link
Contributor

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants