What does the following code return in NodeJS?
I got my degree in mathematics so I would expect this to return the number 25. But actually, the result is quite different- it's the number 7!
If you've taken a look at some open source projects that use Ngrx such as example-app, ngrx-examples , or angular-nye-advanced-ngrx then you may have noticed that they have an interesting way of defining Action types. In this post I'll go over why we use the "type" method and why we construct the Action strings in this specific style. Big thanks to Xavier, @xlozingues, for staying at the office late on a Friday to help me understand this. ?
Yep, another blog post about Angular 2 and Ngrx. In this post we'll look at some ways to create @Effects that don't return an action to the reducer and when you might want to do this.
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.
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.
The posts on this site are written and maintained by Jim Lynch. About Jim...