-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Immutability issue #1
Comments
Your first suggested refactoring looks mutable to me:
You just mutate the talks object one level up in the nesting. Am I missing something? The last refactoring you have looks immutable to me. So the change being more than mere syntax preference:
|
Is this a question for me @apasternack ? Because it's all what's this issue is about. The first "suggested refactoring" is the code from the talk and the repo. The second one is my proposal (which is exactly the same as your last part in comment) so I do not understand. |
Hello @maxime1992, yeah it was a question. I was confused. I thought that first "suggested refactoring" was from you. Now it makes sense! Thanks, wanted to make sure I understood the bit about avoiding mutating state. |
Hi Victor, after watching your talk about tackling state in Angular apps I wanted to dig into the code of this repo and while I was reading your reducer I noticed an immutability issue. Checkout model.ts#L49.
And it should be
Or, I have a preference for this syntax
I made a quick repro of the bug that you can run in chrome console
BTW your talk was great and I can't wait to give a try to ngrx v4 :).
Cheers
The text was updated successfully, but these errors were encountered: