mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-17 05:05:44 +02:00
fase 5
This commit is contained in:
+12
@@ -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 };
|
||||
Reference in New Issue
Block a user