Redux
Last updated
Was this helpful?
Last updated
Was this helpful?
Redux is an application state manager for JavaScript applications, and keeps with the core principals of flux-architecture by having a unidirectional data flow in your application.
How it differs from traditional Flux though, is that instead of multiple stores, you have one global application state. The state is calculated and returned in the reducer. The state management is held else where.
Entire state is stored in an object tree
Easy to debug
Easy to inspect application
Easy to hydrate initial state
Only way to mutate state is to emit an action
Actions describe what happened
Views, network callbacks, etc. will never mutate state
Mutations are centralized and happen in strict order
No race conditions
Actions are objects, they can be logged, serialized, stored, and replayed
Reducers are responsible for modifying the state tree
Pure functions
Take in previous state, action, and return new state
Can be split out into smaller reducers to manage specific parts of state tree