Did the new NGRX update add Object.freeze calls to the signalstore? #4677
PhilippMDoerner
started this conversation in
General
Replies: 1 comment 4 replies
-
Hello, yes v19 introduced "freezing", https://ngrx.io/guide/migration/v19#throw-error-in-dev-mode-on-state-mutation. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just recently updated my application to Angular 19 and I heavily use signalstore.
For some reason at one point I also used signalstore in order to store which route the user last visited:
With Angular 19 and the latest NGRX store this will break routing, because the signal-store now freezes the ActivatedRouteSnapshot inside the router-event, which it did not do before.
The reason this breaks routing is because the angular router will update the data property on an object that has now been frozen.
I'm opening this discussion first in order to ascertain whether that was indeed the change in signalstore.
And second in order to figure out how I could've avoided stumbling into this issue in the first place (or prevent others from stumbling into it).
Because accessing something from the router in a store does not seem like that rare a usecase.
For the most part my current learning is to avoid ever touching anything from routing inside of a store, though I'm not sure what else.
Beta Was this translation helpful? Give feedback.
All reactions