August 2017
Beginner
374 pages
10h 41m
English
Redux executes the main reducer with the current state and the dispatched action. Usually, the main reducer function will pass substates and the action down to other reducers, which then process the action.
A reducer is just a function, and to get the next state, Redux calls it as follows:
let newState = reducer(previousState, action)
Keep in mind that the reducer function has to be pure. Pure means that it does not cause any side effects, such as modifying the previousState variable. Instead of directly modifying the previous state, a pure reducer function copies data from the previous state to create a new state object.
However, being pure also means that reducers should not perform any other side ...
Read now
Unlock full access