Using ImmutableJS in React - Redux Applications

Using ImmutableJS in React - Redux Applications

In this guide, we'll briefly discuss the concept of immutability in software development and how to leverage its benefits when developing React-Redux applications.

Specifically, we'll demonstrate how to use Facebook's Immutable.js library to enforce immutability in our applications.

[…]

Immutable.js is a library that provides us with several immutable data structures, making it easier to implement immutability within our applications.

Any changes to data created using these data structures returns a new object that is the result of the changes.

Immutable.js presents an API which does not update the data in-place, but instead always yields new updated data.

Other than the benefit of not having to worry about accidentally mutating the state of our application directly, Immutable.js data structures are highly performant because of the library's implementation of structural sharing through hash maps and vector tries.

[…]