I've been working a lot recently with the Angular state management library ngr. I even wrote a blog post about setting up your Angular 2 project with ngrx/store and then a follow up post The Basics of"ngrx/effects", @Effect, and Async Middleware for "ngrx/store" in Angular 2. However, after taking a closer look at the official ngrx example project I learned a little trick that harnesses the power of TypeScript to make your coding experience even more fun and less error-prone.
0 Comments
I just went through a pretty embarasseing episode of fighting with a large codebase to figure out a bug, and it turned out in the end that the issues were being caused by improper use of the Object.assign method. In particular, I was using it to manage the state inside my reducer function in an ngrx store, and it was screwing with my whole app! I hope I can remember that you need to first pass in an empty object to Object.assign, and then you pass the object that you want to "assign onto" that empty object.
If you haven't already read my first post about setting up your angular 2 project with Ngrx/store then you should check that out first. In this post we will build on this state management architecture by learning about how to to think about asynchronous actions in the world of ngrx. We'll start with some simple examples and ultimately build up to @Effects that pull data from Firebase database. Let's get started!
I personal like the control you have when using git from the command line, and a nice thing to be able to do is see the changes I've made (duh hehe). I really didn't know the proper name for this so I am calling it the "git commit lifecycle", but basically these are shell scripts you can run to see your changes before you add the changes, after you add them but before committing, and after committing. Enjoy!
|
AuthorThe posts on this site are written and maintained by Jim Lynch. About Jim...
Categories
All
Archives
March 2023
|