August 2017
Beginner
298 pages
7h 4m
English
Reducers are simple functions that receive the action object returned from the actions and then update the state using them. Generally, since our application state is represented as an object which is a key-value pair, we will need to create a reducer for each key (or property). This is the structure of our application state, which we created in the initial state section:
{ posts: [], authors: [], ajaxCalls: { ... },}
We have got three properties in our state, hence, we will need three reducers, namely, postsReducer.js, authorsReducer.js, and ajaxCallsReducer.js. These reducers will represent our application state in the store. We also need another reducer, which will be used to combine these three reducers into a single object that ...
Read now
Unlock full access