You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Immer auto-freezes state when processed in a case reducer. However, we currently do not freeze the initial state. This means that it is possible to mutate the initial state before any actions are dispatched. Not sure if the mutation checker picks up on it or not.
Another issue is that I'm looking at updating the immutability and serialization checks to skip past frozen values for speed. If the initial state isn't frozen, we don't get the benefit there. Now, it's also likely that the initial state is almost empty so it won't take long to scan those values anyway, but I can't see a reason to not freeze the initial state.
Fortunately, it looks like it's trivial to do this by adding:
Immer auto-freezes state when processed in a case reducer. However, we currently do not freeze the initial state. This means that it is possible to mutate the initial state before any actions are dispatched. Not sure if the mutation checker picks up on it or not.
Another issue is that I'm looking at updating the immutability and serialization checks to skip past frozen values for speed. If the initial state isn't frozen, we don't get the benefit there. Now, it's also likely that the initial state is almost empty so it won't take long to scan those values anyway, but I can't see a reason to not freeze the initial state.
Fortunately, it looks like it's trivial to do this by adding:
and using the frozen state instead.
The text was updated successfully, but these errors were encountered: