redux-freeze icon indicating copy to clipboard operation
redux-freeze copied to clipboard

redux-freeze throws on immutablejs objects

Open bdurrer opened this issue 4 years ago • 0 comments

I first reported this at immutablejs. But I think that a fix/workaround might better fit into redux-freeze.

ImmutableJS objects are immutable by design. However, the internal hashCode is calculated lazily and set when it is first requested. As a result, it can happen that _hashCode is being set after an object was added to the store. One could argue that ImmutableJS is to blame, but I think this might be one of the very few exceptions where lazyness is acceptable. It might make sense to somehow add a way to exclude certain objects in the store from being frozen, e.g. via a configurable function that decides whether to freeze or not.

bdurrer avatar Jul 06 '20 09:07 bdurrer