From the course: Learning NgRx

Unlock the full course today

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

Actions with NgRx

Actions with NgRx - Angular Tutorial

From the course: Learning NgRx

Start my 1-month free trial

Actions with NgRx

- [Instructor] So in this video, we're going to implement our first reducer function with ngrx. The first action we are going to implement is the most obvious one: AddZipcode In order to do this I'm going to rely on ngrx's schematics once more. So let's open a terminal and run a command to generate this action. So in my terminal I'm going to run ng generate as always. And what we want to generate is from the ngrx/schematics. And that's an action that we are going to generate, and that action, I'm going to call it Zipcode, and just like we did earlier, we gonna use a group flag so that it creates a specific folder for those actions. So there we go, the zipcode.actions.ts was generated and added to the actions folder. Let's take a look at what it looks like. So by default it creates a Load Zipcodes action with a string description. It creates a class that implements the action class from ngrx and it also creates a type ZipcodeActions which is going to group all of our different actions…

Contents