A bunt in baseball is a gentle tap of the ball that causes the opposing team to scramble from their usual positions (catcher and pitcher in particular). Its goal is to get the hitter to a single base or move other runners to the next base.
What is the meaning of "bunt"? - English Language & Usage Stack Exchange
Immer (German for: always) is a tiny package that allows you to work with immutable state in a more convenient way.
The Immer package exposes a produce function that does all the work. ... produce takes a base state, and a recipe that can be used to perform all the desired mutations on the draft that is passed in.
Redux + Immer is extensively covered in the documentation of Redux Toolkit. For Redux without Redux Toolkit, the same trick as applied to useReducer above can be applied: wrap the reducer function with produce, and you can safely mutate the draft!
Provides installation instructions for Immer, a library for creating immutable states in JavaScript applications.
API overview ... Importing immer In most cases, the only thing you need to import from Immer is produce: ... Note that in older versions, produce was also available as default export (e.g. import produce from "immer" was also valid, but that is no longer the case to improve eco system compatibility.
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. The TypeScript typings automatically remove readonly modifiers from your draft types and return a value that matches your original type. See this practical example: