UNPKG

@sandstack/neuron

Version:

Neuron is a lightweight framework agnostic global state manager for Javascript apps, with React support

3 lines (2 loc) 745 B
System.register("shallow",["../core"],function(s,c){"use strict";var n;return{setters:[l=>{n=l.Module}],execute:function(){const l=s("shallowEqual",(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),a=Object.keys(r);if(t.length!==a.length)return!1;for(const o of t)if(e[o]!==r[o])return!1;return!0}return!1}),u=s("Shallow",()=>new n({name:"@sandstack/neuron-shallow",onDispatch:e=>{l(e.prevState,e.state)&&e.cancelDispatch()}}));globalThis.NeuronShallow={Shallow:u,shallowEqual:l}}}}); //# sourceMappingURL=shallow.js.map