
Introduction to Immer - GitHub Pages
Immer (German for: always) is a tiny package that allows you to work with immutable state in a more convenient way.
Using produce | Immer - GitHub Pages
The Immer package exposes a produce function that does all the work. produce(baseState, recipe: (draftState) => void): nextState produce takes a base state, and a recipe that can be used to perform …
Installation | Immer - GitHub Pages
To make sure Immer is as small as possible, features that are not required by every project has been made opt-in, and have to be enabled explicitly. This ensures that when bundling your application for …
React & Immer - GitHub Pages
Deep updates in the state of React components can be greatly simplified as by using Immer. The following example shows how to use produce in combination with useState, and can be tried on …
Using TypeScript or Flow | Immer - GitHub Pages
The Immer package ships with type definitions inside the package, which should be picked up by TypeScript and Flow out of the box and without further configuration.
Immer 入门 - GitHub Pages
使用 Immer 时,您无需学习专用 API 或数据结构即可从范例中受益。 使用 Immer,您将使用纯 JavaScript 数据结构,并使用众所周知的安全地可变 JavaScript API。
Update patterns | Immer - GitHub Pages
Working with immutable data, before Immer, used to mean learning all the immutable update patterns. To help 'unlearning' those patterns here is an overview how you can leverage the built-in JavaScript …
Frequently Asked Questions | Immer - GitHub Pages
Frequently Asked Questions Q: How does Immer work? Read the (second part of the) introduction blog. Q: Does Immer use structural sharing? So that my selectors can be memoized and such? A: Yes Q: …
API overview | Immer - GitHub Pages
API overview ... Importing immer In most cases, the only thing you need to import from Immer is produce:
安装 | Immer - GitHub Pages
为确保 Immer 尽可能小,并非每个项目都需要的功能已选择加入,并且必须明确启用。 这可确保在将您的应用程序捆绑用于生产时,未使用的功能不会占用任何空间。