Immer
Immer's `produce` wraps state in a Proxy so you write ordinary mutating code (`draft.todos.push(...)`) and it records the mutations to build a correctly copied immutable result. Redux Toolkit runs every case reducer inside Immer, eliminating hand-written spread chains and their off-by-one-level bugs.
This Concept is waiting for its first lesson!
Immer's `produce` wraps state in a Proxy so you write ordinary mutating code (`draft.todos.push(...)`) and it records the mutations to build a correctly copied immutable result. Redux Toolkit runs every case reducer inside Immer, eliminating hand-written spread chains and their off-by-one-level bugs.
Are you a teacher? Sign in to start contributing.
Sign In