diff --git a/dist/simple-react-store.js b/dist/simple-react-store.js index 8d94081..1c13457 100644 --- a/dist/simple-react-store.js +++ b/dist/simple-react-store.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.simpleReactStore=t(require("react")):e.simpleReactStore=t(e.react)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var f,a=[],s=!1,l=-1;function p(){s&&f&&(s=!1,f.length?a=f.concat(a):l=-1,a.length&&d())}function d(){if(!s){var e=c(p);s=!0;for(var t=a.length;t;){for(f=a,a=[];++l1)for(var n=1;n=0;e--){var t=E[e];!1===t.modified&&(Array.isArray(t.base)?C(t)&&S(t):z(t)&&S(t))}}();var c=void 0;if(void 0!==u&&u!==r){if(r[o].modified)throw new Error(i);c=b(u)}else c=b(r);return y(E,function(e,t){t.finished=!0}),c}finally{E=n}}t.default=function e(t,n){if(1!==arguments.length&&2!==arguments.length)throw new Error("produce expects 1 or 2 arguments, got "+arguments.length);if("function"==typeof t){if("function"==typeof n)throw new Error("if first argument is a function (curried invocation), the second argument to produce cannot be a function");var u=n,f=t;return function(){var t=arguments;return e(void 0===t[0]&&void 0!==u?u:t[0],function(e){return t[0]=e,f.apply(e,t)})}}if("function"!=typeof n)throw new Error("if first argument is not a function, the second argument to produce should be a function");if("object"!==(void 0===t?"undefined":r(t))||null===t)return n(t);if(!l(t))throw new Error("the first argument to an immer producer should be a primitive, plain object or array, got "+(void 0===t?"undefined":r(t))+': "'+t+'"');return c?function(e,t){var n=m;m=[];try{var r=x(void 0,e),u=t.call(r,r),c=void 0;if(void 0!==u&&u!==r){if(r[o].modified)throw new Error(i);c=b(u)}else c=b(r);return y(m,function(e,t){return t.revoke()}),c}finally{m=n}}(t,n):D(t,n)}}.call(this,n(0))},function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectDevTools=t.Store=void 0;var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";this.state!==e&&(this.state=e,this.notifySubscribers(e,t))}},{key:"updateState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=(0,i.default)(this.state,e);this.setState(n,t)}},{key:"getState",value:function(){return this.state}},{key:"onUpdate",value:function(e){this.subscribers.push(e)}},{key:"unsubscribe",value:function(e){this.subscribers=this.subscribers.filter(function(t){return t!==e})}},{key:"connect",value:function(e){var t=this;return function(n){return function(i){function u(){var n,r,o;f(this,u);for(var i=arguments.length,a=Array(i),s=0;s1)for(var n=1;n=0;e--){var t=S[e];!1===t.modified&&(Array.isArray(t.base)?C(t)&&E(t):z(t)&&E(t))}}();var c=void 0;if(void 0!==u&&u!==r){if(r[o].modified)throw new Error(i);c=b(u)}else c=b(r);return y(S,function(e,t){t.finished=!0}),c}finally{S=n}}t.default=function e(t,n){if(1!==arguments.length&&2!==arguments.length)throw new Error("produce expects 1 or 2 arguments, got "+arguments.length);if("function"==typeof t){if("function"==typeof n)throw new Error("if first argument is a function (curried invocation), the second argument to produce cannot be a function");var u=n,f=t;return function(){var t=arguments;return e(void 0===t[0]&&void 0!==u?u:t[0],function(e){return t[0]=e,f.apply(e,t)})}}if("function"!=typeof n)throw new Error("if first argument is not a function, the second argument to produce should be a function");if("object"!==(void 0===t?"undefined":r(t))||null===t)return n(t);if(!l(t))throw new Error("the first argument to an immer producer should be a primitive, plain object or array, got "+(void 0===t?"undefined":r(t))+': "'+t+'"');return c?function(e,t){var n=m;m=[];try{var r=x(void 0,e),u=t.call(r,r),c=void 0;if(void 0!==u&&u!==r){if(r[o].modified)throw new Error(i);c=b(u)}else c=b(r);return y(m,function(e,t){return t.revoke()}),c}finally{m=n}}(t,n):D(t,n)}}.call(this,n(0))},function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.connectDevTools=t.Store=void 0;var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";this.state!==e&&(this.state=e,this.notifySubscribers(e,t))}},{key:"updateState",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=(0,i.default)(this.state,e);this.setState(n,t)}},{key:"getState",value:function(){return this.state}},{key:"onUpdate",value:function(e){this.subscribers.push(e)}},{key:"unsubscribe",value:function(e){this.subscribers=this.subscribers.filter(function(t){return t!==e})}},{key:"connect",value:function(e){var t=this;return function(n){return function(i){function u(){var n,r,o;f(this,u);for(var i=arguments.length,a=Array(i),s=0;s