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
- [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…
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
-
-
-
-
Describing state with NgRx5m
-
(Locked)
Actions with NgRx3m 51s
-
(Locked)
Reducers in NgRx5m 56s
-
(Locked)
The NgRx store: Dispatch an action2m 57s
-
(Locked)
The NgRx store: Listen to state updates3m 43s
-
(Locked)
Set up effects for asynchronous tasks3m 16s
-
(Locked)
Implementation of effects4m 36s
-
(Locked)
Challenge: Complete the code in the project to remove a zip code from the list52s
-
(Locked)
Solution: Source code with comments1m 24s
-
-
-
-