August 2017
Beginner
374 pages
10h 41m
English
As we discussed in the previous chapters, Redux reducers are simply functions. This means that we can apply the same pattern to them and create higher-order reducer functions (or, in short, higher-order reducers).
A higher-order function is a function that returns a function (and/or takes a function as an argument). A higher-order reducer is a reducer that returns a reducer (and/or takes a reducer as an argument).
For example, a higher-order reducer that simply calls the reducer (effectively not doing anything special) will look like this:
function doNothingWith (reducer) { return function (state, action) { return reducer(state, action) }}
In fact, the preceding example is both types of higher-order function: It takes ...
Read now
Unlock full access