Next()

Let's look at how next() can be used to allow running code before and after passing an action to the reducer.

If we were to build our own middleware implementation, we would probably want the ability to run code both before an action is passed to the reducers and after. One approach would be to define two different callbacks for before and after.

Get hands-on with 1400+ tech skills courses.