Chapter 12Using Redux to Manage State

Now that we are using a reducer to manage state in our React app, we’ve come up against an issue with integrating our asynchronous actions with our reducer. We’ve chosen to keep our asynchronous actions outside our reducer, which means we need to remember to trigger the asynchronous actions when we call the reducer.

This brings us to a tool called Redux[72] and its associated libraries, React Toolkit[73] and React Redux.[74] Redux is a more complex version of the reducer and store pattern we’ve been working with. I don’t cover a lot of the extended complexity here, but Redux has support for more complex combinations of reducers and actions than we need, at least at the moment. It bills itself as ...

Get Modern Front-End Development for Rails, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.