zustand-mutative
Version:
A Mutative middleware for Zustand enhances the efficiency of immutable state updates.
3 lines (2 loc) • 535 B
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("mutative")):"function"==typeof define&&define.amd?define(["exports","mutative"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZustandMutative={},e.Mutative)}(this,(function(e,t){"use strict";const n=(e,n)=>(i,s,o)=>(o.setState=(e,s,...o)=>{const a="function"==typeof e?t.create(e,n?Object.assign(Object.assign({},n),{enablePatches:!1}):n):e;return i(a,s,...o)},e(o.setState,s,o));e.mutative=n}));
//# sourceMappingURL=index.umd.js.map