This commit is contained in:
2026-03-18 20:54:43 +01:00
parent b3c8b77f12
commit 9fe656b34c
8058 changed files with 912898 additions and 23 deletions
+12
View File
@@ -0,0 +1,12 @@
import { produce } from 'immer';
const immerImpl = (initializer) => (set, get, store) => {
store.setState = (updater, replace, ...args) => {
const nextState = typeof updater === "function" ? produce(updater) : updater;
return set(nextState, replace, ...args);
};
return initializer(store.setState, get, store);
};
const immer = immerImpl;
export { immer };