@sandstack/neuron
Version:
Neuron is a lightweight framework agnostic global state manager for Javascript apps, with React support
3 lines (2 loc) • 735 B
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../core"),l=(e,r)=>{if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0}if(!Array.isArray(e)&&!Array.isArray(r)){const t=Object.keys(e),o=Object.keys(r);if(t.length!==o.length)return!1;for(const n of t)if(e[n]!==r[n])return!1;return!0}return!1},s=()=>new a.Module({name:"@sandstack/neuron-shallow",onDispatch:e=>{l(e.prevState,e.state)&&e.cancelDispatch()}});globalThis.NeuronShallow={Shallow:s,shallowEqual:l};exports.Shallow=s;exports.shallowEqual=l;
//# sourceMappingURL=index.cjs.map
;