Summary: Redux Fundamentals
Let's briefly recap what we have learned in this chapter.
We'll cover the following
Redux principles
Redux is based on the following three principles:
-
A Redux app has a single source of truth called the store.
-
The store is read-only and can only be changed by dispatching actions.
-
Changes are made using pure functions called reducers.
Redux architecture
-
We should keep our entire app’s state in a single JavaScript object called store.
-
Our app’s components/views subscribe to the store for the required data.
-
When the state needs to get updated through user interactions, the component/view dispatches an action. The action contains information about the new data.
-
The action forwards the information to a reducer function. The reducer uses that information to modify the state.
-
Since the component/view has already been subscribed to the store, it gets updated automatically with the new data.
Get hands-on with 1400+ tech skills courses.