text: import t,{createContext as r,useReducer as e,useContext as n}from"react";function i(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=[],n=!0,i=!1,a=void 0;try{for(var o,c=t[Symbol.iterator]();!(n=(o=c.next()).done)&&(e.push(o.value),!r||e.length!==r);n=!0);}catch(t){i=!0,a=t}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return e}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var a=r({state:{},dispatch:function(){}});function o(r){var n=r.initialState,o=void 0===n?{}:n,c=r.children,l=r.reducer,u=r.context,f=function(t,r){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.indexOf(n)<0&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)r.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(e[n[i]]=t[n[i]])}return e}(r,["initialState","children","reducer","context"]),p=i(e(l,o),2),s=p[0],y=p[1],d=u||a;return t.createElement(d.Provider,Object.assign({value:{state:s,dispatch:y}},f),c)}function c(t,r,e){var i=n(e||a),o=i.state,c=i.dispatch,l=t?t(o):o,u=r?r(c):{dispatch:c};return Object.assign({},l,u)}export{o as MicroStoreProvider,c as useMicroStore};
  