From the course: React: Server-Side Rendering

Unlock the full course today

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

Add Redux reducers

Add Redux reducers - React.js Tutorial

From the course: React: Server-Side Rendering

Start my 1-month free trial

Add Redux reducers

- The next step to complete Redox is to add the reducers. Basically the function that will take the action dispatch by the application and then update the store with the new information. And therefore the application will be able to update its views with the updated data. So let's go ahead and build that up. So, I'm back into the store JS file and what I'm going to do right after my actions, I'm going to create my reducers. So let's go ahead and again take a note, reducers. And, what I'm going to do is export, a Function called reducer. And I'm going to pass inside as a variable. The state with the initial state. Like so. And I'm going to pass action. And inside of that function we're going to have a switch statement. Which will pass the action type. So remember what we've done here is we have these functions or actions there are calling or dispatch from the application. And when they're called, we're returning…

Contents