When NgRX 4 came out and I discovered that the “right” way of creating Actions is to use TypeScript classes and not Object Literals, I was a bit surprised. Why would you use a Class that requires you to use the “new” keyword? Why would you put multiple classes in one file? This is insane!
For the last 18 months, I’ve been working for an organization that has what some might consider a unique requirement. Because of where our application’s data is sourced, we need to aggregate data on the client side rather than on the server. What this means is that for any one screen, we may make multiple calls to the server to grab all the data we need. Fortunately, because we adopted NgRX early in our adoption of Angular, we could avoid a lot of the headaches associated with client-side aggregation.
As I’ve been interviewing for a new contract, the question, “How do we Upgrade to Angular from …?” has come up several times. And as I’ve thought about the question, several patterns have emerged.
This past week I took a stab at implementing NgRX 4 Lazy Loading and learned a few things that weren’t obvious to me. I thought you’d want to hear about them.
I made a tweak to my Angular code process over the last month or so that has resulted in greater productivity in my development environment and fewer bugs.
Now, I didn’t make this change because I thought it would improve my productivity. At least that wasn’t the primary reason. I made the change because I thought it would reduce the chance of introducing bugs into my code. And while it does reduce the number of bugs in my code, the result has been generally improved productivity.
What is this great secret?