immer-adapter
immer-adapter copied to clipboard
not working with dynamic selector
@ImmutableSelector() is not working when using dynamic selector with arguments. See error below.
First argument to `createDraft` must be a plain object, an array, or an immerable object
repro on stackblitz: https://stackblitz.com/edit/ngxs-repro-hgjaa9?file=src/app/app.state.ts
What is the right way to guarantee immutability when using dynamic selectors?
The default primitives (String, Number, Boolean) are immutable, you don’t need then @ImmutableSelector, @ImmutableContext
Hi @splincode I'm not creating a counter in my app :) this was just the simplest way to make a repro. I could change the StateModel to an object or an array, the behavior is the same.
So, I will investigate