Replies: 2 comments 3 replies
-
Both will freeze the state. https://github.com/datorama/akita/blob/master/libs/akita/src/lib/store.ts#L181 |
Beta Was this translation helpful? Give feedback.
1 reply
-
I see the issue. We only freeze it if we get a function: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've been trying Akita out and I have a question about the implementation of
Store
vsEntityStore
operations. I know immutability is advised to be handled by the developer, but theEntityStore
operations (add, update, etc.) seem to 'freeze' the object passed as state themselves. This results in an immutable object, which when I retrieve from the store, if I want to mutate it, I have to 'unfreeze it' somehow. I guess this is the intent.In contrast, I was not able to achieve this using the regular
Store
. However I try to update the store (with a callback or with a plain object), I end up with an object that, when I get back from the store, can mutate and the changes are reflected in the store value.It seems that immutability comes out of the box for
EntityStore
, but not forStore
. Wanted to ask if my understanding is correct.Beta Was this translation helpful? Give feedback.
All reactions