From the course: Building React and ASP.NET Core Applications

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Redux reducers

Redux reducers

From the course: Building React and ASP.NET Core Applications

Start my 1-month free trial

Redux reducers

- [Instructor] We learned that we define actions to represent the fact, or the what happens, and then we user reducers to update this state according to these actions. To bring them together, we use store. But what else can we do using the store? Now we know that the store will hold the application state, but if you want to access the application state you can use the getState method, and if you want to update it, you can use the dispatch method, which takes as a parameter, an action. And if you want to listen for different store changes, you can subscribe to it by using the subscribe method. Now it's important to mention that we only have a single store in a Redux application. So let's now go to visual code and see this in action. In here I'll go to Explorer, then ClientApp, then source, and then inside source, I'll create a new folder named store. Now I'm not naming it stores because we only have one store in a…

Contents