Become a member
to unlock all features

Create an egghead account to access 5000+ tutorials and resources from expert developers.

Create account

    Simplify Creating Immutable Data Trees With Immer


    Immer is a tiny library that makes it possible to work with immutable data in JavaScript in a much more straight-forward way by operating on a temporarily draft state and using all the normal JavaScript API's and data structures. The first part of the lesson explains how to use Immer, and the second part of the lesson shows you how it can be used to simplify, for example, Redux reducers.

    Immer has a few unique features:

    • Supports arbitrary, deep modifications in immutable data trees
    • Strongly typed
    • Uses JavaScript native data structures, no new API to learn
    • Automatically freezes any data that is produced