Using immutable data structures provides many benefits, including making your code easier to reason about and less prone to bugs.
Immutable Data With
Using immutable data structures provides many
beneﬁts, including making your code easier to
reason about and less prone to bugs.
Detect and distribute
changes in data
Today we’re looking at
updates and new features
is so important ?
Is deletable ?
Using immutable data structures
provides many beneﬁts,
including making your code
easier to reason about and less
prone to bugs.
● Immutable objects are simpler to
construct, test, and use
● Truly immutable objects are always
● They help to avoid temporal coupling
● Their usage is side-effect free
Aug 4, 2014
Keeps previous state, produces new next state
How does Immer
● Proxy root
● Lazily create proxy when a ﬁeld is
● Upon write, create shallow clone
● Upon ﬁnish, combine clones, freeze the
objects, arrays, Sets and Maps. No new
APIs to learn!
● Strongly typed, no string based paths
● Structural sharing out of the box
● Object freezing out of the box
● Deep updates are a breeze
● Boilerplate reduction. Less noise, more
● First class support for patches
● Small size 6kb