mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
docs(immer-doc): add npm installation section in immer middleware docs (#1347)
This commit is contained in:
parent
e8b05d8179
commit
200d5bc10e
@ -3,10 +3,20 @@ title: Immer middleware
|
||||
nav: 16
|
||||
---
|
||||
|
||||
The immer middleware enables you to use an immutable state in a more convenient
|
||||
The [Immer](https://github.com/immerjs/immer) middleware enables you to use an immutable state in a more convenient
|
||||
way. Also, with `Immer` you can simplify handling immutable data structures on
|
||||
`Zustand`.
|
||||
|
||||
## Installation
|
||||
|
||||
In order to use the Immer middleware in `Zustand`, you will need to install `Immer` as a direct dependency.
|
||||
|
||||
```bash
|
||||
npm install immer
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Updating simple states
|
||||
|
||||
```ts
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user