Redux

Look at redux_toolkit.md for the modern usage

Three Principles

1) The global statearrow-up-right of your application is stored in an object tree within a single storearrow-up-right.

2) The only way to change the state is to emit an actionarrow-up-right, an object describing what happened.

3) To specify how the state tree is transformed by actions, you write pure reducersarrow-up-right. (pure means no random or async)

Why Redux in a World with React Context?

  • You have large amounts of application state that are needed in many places in the app

  • The app state is updated frequently over time

  • The logic to update that state may be complex

  • The app has a medium or large-sized codebase, and might be worked on by many people

Last updated