The Redux parts
There are a few components of the Redux architecture: actions, a reducer function, and the store. The reducer is a pure function that gets a state and an action for an input, and then returns a new single (reduced) state object.
Actions are plain objects that must include a property type that will be used by the reducer function to perform a type of action to create the next state.
The only way to change a state is through dispatching actions. Redux strictly follows the Flux's unidirectional data flow architecture, and updating the state should happen only from actions to a reducer and then to the store. The following diagram shows the data flow of Redux:
The Store is where the state is persisted, and it's only one store ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access