...

/

Ensuring Immutability

Ensuring Immutability

Learn how to ensure immutability in Redux.

Here are a number of methods and tools that strive to provide immutability.

Libraries

Deep Freeze

One approach is to use libraries like deep-freeze that will throw errors every time someone tries to mutate a frozen object.

While JavaScript provides an Object.freeze() method, it only freezes the object it is applied to, not its children objects. Deep-freeze and similar libraries perform nested freezes and ...