timdeschryver / ngrx-immer

Immer wrappers around NgRx methods createReducer, on, and ComponentStore
https://www.npmjs.com/package/ngrx-immer
MIT License
120 stars 7 forks source link

The Selector of ImmerComponentStore isn't working similarly as Component Store #9

Closed nhvu95 closed 3 years ago

nhvu95 commented 3 years ago

https://stackblitz.com/edit/angular-ivy-ebkzxz?file=src/app/non-immer/non-immer.component.ts Please follow the demo above. and please check the console log.

timdeschryver commented 3 years ago

You're right, but this is by design. Immer creates an immutable state, thus you can't simply update it. You're only allowed to update state in the update methods.