Immutable.js is yet another JavaScript library. If this makes you cringe, don't worry—I feel your pain. The last thing that JavaScript developers need is another library to learn. Then, I used the library and realized that Immutable.js is one of those gems that you don't have to feel bad about including as a dependency.
This first chapter will show you what Immutable.js is all about. Hopefully, I can dispel any mysteries about Immutable.js while making you want to try it out for yourself.
Here's what you'll learn in this chapter before getting your hands dirty in the chapters that follow:
- Why changes to data are destructive
- What are persistent changes?
- The hybrid functional/object approach used by Immutable.js
- Why data flows in one direction in Immutable.js
- Alternative libraries and approaches to immutability