liveBook · Manning

Immer

Immer is a JavaScript library that enables immutable state updates through mutable draft views, producing modified copies with structural sharing.

How 2 Manning books explain it

Secrets of the JavaScript Ninja, Third Edition

Immer is a JavaScript library that enables immutable updates by presenting mutable draft views and producing modified copies with structural sharing.

How it is used
Creates modified copies of immutable collections through mutation-style updates.
How deep it goes
Explains draft creation and Proxy-based copy construction, without detailing Immer’s internal copy algorithm.
Examples
Demonstrates adding an array item and updating Map data in a read-only TypeScript state.
What you can do after
Apply Immer’s `produce` function to create modified copies of read-only collection state.

Read how Secrets of the JavaScript Ninja, Third Edition explains Immer →

React in Depth

Immer is a JavaScript library that lets code express immutable state updates through drafts that can be modified directly.

How it is used
Simplifies immutable reducer updates when nested objects and arrays make manual copying cumbersome.
How deep it goes
Explains draft mutation, proxy-based change recording, and immutable playback, but stops short of detailing the implementation internals.
Examples
Demonstrates updating a nested done array with manual copying and then with produce().
What you can do after
Apply it via produce() to write reducers that mutate drafts while returning immutable state updates.

Read how React in Depth explains Immer →

Related concepts

Questions about Immer

What is Immer?

Immer is a JavaScript library that enables immutable state updates through mutable draft views, producing modified copies with structural sharing.

Which Manning books explain Immer?

Secrets of the JavaScript Ninja, Third Edition and React in Depth.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.