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

Unlock the full course today

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

Redux actions

Redux actions

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

Start my 1-month free trial

Redux actions

- [Instructor] In Redux, actions are payloads of information that send data from your application to your store and they are the only source of information for the store. So let us go to Visual code and see them in action. In here before we start writing anything let us install some packages. So right click on Client App, then Open in Terminal. Here, I'll write, npm install, where we'll install Redux, then react-Redux and then react-thunk. We need the react-thunk library to work with promises. So now that the packages were installed, let us go inside the Client App folder, then inside source. And then here we are going to create a new folder named Actions. Then inside the Actions we are going to create our first action file, so I'll name this file tripActions.JS. At the top let us import axios, so import axios from axios. Now in here let us define the constants that we are going to use this type for sending requests. So, I'll…

Contents