From the course: Building React and ASP.NET Core Applications
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Redux store
From the course: Building React and ASP.NET Core Applications
Redux store
- [Instructor] The React reducers specify how the application's state changes. Now, it's important to know that the actions that we created on the last part can describe only what happens. But they don't describe how the application's state changes. So, let us go to Visual Code and create our reducer. In here I will go to the Explorer, and then inside src folder, I'll create a new folder for reducers. So I'll just name it reducers. Then inside this folder, let us create a new file named tripReducers.js. The first thing that we need to do at the top is that we need to import all the actions. So I'll just write in here import, and then I'll import the GET_ALL_TRIPS_REQUEST. So, that's going to be from, you write dot dot to go a step back, then actions/tripActions. So get the GET_ALL_TRIPS, then we'll get the GET_ALL_TRIPS_SUCCESS and the GET_ALL_TRIPS_ERROR. Now, let us define the initial state of our app. So for…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.