O'Reilly logo

Flux Architecture by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Immutable.js

The Immutable.js library from Facebook provides immutable JavaScript data structures. This might sound trivial but there's a lot that goes on behind the scenes to make this work, namely creating new instances from transformations as efficiently as possible.

In this section, we'll look at immutable lists and maps. These are viable substitutes for arrays and plain objects, respectively, in our Flux store data. Then, we'll look at how Immutable.js can compose complex transformations without the need for intermediary representations. Finally, we'll see how Immutable.js returns the same instance when there's no mutations after running through a transformation, allowing for efficient change detection.

Immutable lists and maps

We'll start ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required