From the course: Building Modern Projects with React
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Creating Redux actions
From the course: Building Modern Projects with React
Creating Redux actions
- Now that we've performed the basic set-up to add Redux to our React app, we're going to actually create some actions and reducers that our application can use to help keep track of its state. In this video, we're going to start off by defining some Redux actions. So the first thing we're going to do is create a new file inside of our source slash to do directory, and we'll call it actions dot js. And then, inside this file, we're going to define a create to do action that our app will fire whenever the user types something in the new to do form component that we created and presses the create to do button. We'll see how this all fits together later. So we saw in a previous video that every action is essentially just a JSON object with a type property and possibly a payload. And because of this, we're going to start off by creating a constant for the actions type. We're going to say export const create to do, all…
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.
Contents
-
-
-
-
-
Why do you need Redux?4m 11s
-
How does Redux work?4m 35s
-
Adding Redux to a React app3m 24s
-
Creating Redux actions4m 16s
-
Creating reducers6m 23s
-
Connecting components to the store7m 1s
-
Running a React-Redux application4m 32s
-
Persisting the Redux store6m 43s
-
Redux DevTools3m 34s
-
Redux best practices3m 53s
-
Challenge: Adding a Redux flow1m 56s
-
Solution: Adding a Redux flow4m 14s
-
-
-
-
-
-