- Notifications
You must be signed in to change notification settings - Fork0
Mutative wrapper with full Immer API compatibility
License
NotificationsYou must be signed in to change notification settings
exuanbo/mutative-compat
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Mutative wrapper with fullImmer API compatibility.
# npmnpm install mutative-compat mutative# Yarnyarn add mutative-compat mutative# pnpmpnpm add mutative-compat mutative
Optional but useful 😈:
// package.json{"dependencies":{"immer":"npm:mutative-compat@^0.1.x","mutative":"^1.0.2",},// npm"overrides":{"immer":"npm:mutative-compat@^0.1.x"},// Yarn"resolutions":{"immer":"npm:mutative-compat@^0.1.x"},// pnpm"pnpm":{"overrides":{"immer":"npm:mutative-compat@^0.1.x"}}}
This way you can replaceimmer withmutative in some opinionated libraries like Redux Toolkit.
- The
freezefunction will only freeze shallowly, the second argumentdeep?: booleanis omitted. - In nested
producecalls, the inner results will never be frozen even if they're not used in the outer recipe.
For other differences(that you probably will never notice), seemutative/test/immer-non-support.test.ts
MIT License @ 2023-PresentXuanbo Cheng
About
Mutative wrapper with full Immer API compatibility
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.