Examples and exercises for Safari Live Training course "Using Redux for managing state in complex React applications".
Web applications of today are becoming increasingly more complex. Our apps commonly need to request data from various sources and handle rich user interactions, which can all become difficult to keep track of as our applications scale. Thus, complex modern web apps generally use some form of state management, of which the Redux library has become one of the more common solutions that web developers will reach for, due in part to its relative simplicity, ability to test, as well as for its developer tooling.
Redux (which is based on the Flux architecture created by the team at Facebook) follows a very simple paradigm built around the concept of unidirectional data flow. This makes it easy to follow what is happening in your application, and to debug when things break. In this training, we will dive into why a library such as Redux is helpful and the problems that it solves, how you can use it in your application (especially if you are already using the React framework), as well as digging into the internals of how it works so that you could write your own state management solution from scratch.
There are three exercises that I would like to work through with you. They are not challenging, and there is no single "solution" for them. The goal instead is to get you to think in Redux, all while applying the core concepts and learning some new tips around improving the structure, architecture, and performance of you application.
There are several example apps included, a few of which are the "solutions" to each of the exercises in the previous section. I hope for these to serve as a reference point when you are working through the exercises, as well as a point to come back to if you need to remember how a particular concept works.