react-native-global-state-hooks 9.0.4 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GlobalStore.js +1 -1
- package/GlobalStoreAbstract.js +1 -1
- package/asyncStorageWrapper.js +1 -1
- package/bundle.js +1 -1
- package/createContext.js +1 -1
- package/createCustomGlobalState.js +1 -1
- package/createGlobalState.js +1 -1
- package/generateStackHash.js +1 -1
- package/getAsyncStorageItem.js +1 -1
- package/index.d.ts +0 -1
- package/isRecord.js +1 -1
- package/package.json +6 -6
- package/setAsyncStorageItem.js +1 -1
- package/shallowCompare.js +1 -1
- package/throwWrongKeyOnActionCollectionConfig.js +1 -1
- package/types.js +1 -1
- package/uniqueId.js +1 -1
- package/uniqueSymbol.js +1 -1
- package/useStableState.js +1 -1
- package/webpack.config.js +15 -1
- package/debounce.d.ts +0 -1
- package/debounce.js +0 -1
package/GlobalStore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("./getAsyncStorageItem.js"),require("./setAsyncStorageItem.js"),require("react-hooks-global-states/GlobalStoreAbstract")):"function"==typeof define&&define.amd?define(["./getAsyncStorageItem.js","./setAsyncStorageItem.js","react-hooks-global-states/GlobalStoreAbstract"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("./getAsyncStorageItem.js"),require("./setAsyncStorageItem.js"),require("react-hooks-global-states/GlobalStoreAbstract")):t["react-native-global-state-hooks"]=e(t["./getAsyncStorageItem.js"],t["./setAsyncStorageItem.js"],t["react-hooks-global-states/GlobalStoreAbstract"])}(this,((t,e,r)=>(()=>{"use strict";var n={493:e=>{e.exports=t},466:t=>{t.exports=e},413:t=>{t.exports=r}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}var i={};return(()=>{var t=i;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(){r=function(){return n};var t,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function y(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),c=new G(n||[]);return i(a,"_invoke",{value:L(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=y;var p="suspendedStart",v="suspendedYield",g="executing",d="completed",b={};function m(){}function w(){}function S(){}var j={};f(j,u,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(R([])));O&&O!==o&&a.call(O,u)&&(j=O);var _=S.prototype=m.prototype=Object.create(j);function A(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,r){function n(o,i,c,u){var s=h(t[o],t,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(s.arg)}var o;i(this,"_invoke",{value:function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}})}function L(e,r,n){var o=p;return function(a,i){if(o===g)throw new Error("Generator is already running");if(o===d){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?d:v,s.arg===b)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=d,n.method="throw",n.arg=s.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(r){if(r||""===r){var n=r[u];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function e(){for(;++o<r.length;)if(a.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(e(r)+" is not iterable")}return w.prototype=S,i(_,"constructor",{value:S,configurable:!0}),i(S,"constructor",{value:w,configurable:!0}),w.displayName=f(S,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,f(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},n.awrap=function(t){return{__await:t}},A(E.prototype),f(E.prototype,s,(function(){return this})),n.AsyncIterator=E,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new E(y(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},A(_),f(_,l,"Generator"),f(_,u,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=R,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},n}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var r=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"==e(r)?r:String(r)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f(t);if(e){var o=f(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return s(this,r)}}function s(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}var y=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,c)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStore=void 0;var h=a(413),p=a(493),v=a(466),g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(f,t);var e,o,a,i=u(f);function f(t){var e,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),(e=i.call(this,t,o)).asyncStorage=null,e.getMetadata=function(){var t,r;return(null===(t=e.asyncStorage)||void 0===t?void 0:t.key)?Object.assign({isAsyncStorageReady:!1,asyncStorageKey:e.asyncStorage.key},null!==(r=e.metadata)&&void 0!==r?r:{}):e.metadata},e._onInitialize=function(t){var n=t.setState,o=t.getState,a=t.setMetadata;return y(l(e),void 0,void 0,r().mark((function t(){var e;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(f.isAsyncStorageAvailable(this.asyncStorage)){t.next=2;break}return t.abrupt("return");case 2:return a((function(t){return Object.assign(Object.assign({},null!=t?t:{}),{isAsyncStorageReady:!1})})),t.next=5,(0,p.getAsyncStorageItem)(this.asyncStorage);case 5:e=t.sent,a((function(t){return Object.assign(Object.assign({},null!=t?t:{}),{isAsyncStorageReady:!0})})),null===e&&(e=o(),(0,v.setAsyncStorageItem)(e,this.asyncStorage)),n(e,{forceUpdate:!0});case 9:case"end":return t.stop()}}),t,this)})))},e._onChange=function(t){var r=t.getState;f.isAsyncStorageAvailable(e.asyncStorage)&&(0,v.setAsyncStorageItem)(r(),e.asyncStorage)},e.onInitialize=null,e.onChange=null,e.onInit=function(t){var r;null===(r=e._onInitialize)||void 0===r||r.call(l(e),t)},e.onStateChanged=function(t){var r;null===(r=e._onChange)||void 0===r||r.call(l(e),t)},e.asyncStorage=null!==(n=o.asyncStorage)&&void 0!==n?n:null,e.setMetadata((function(t){var r,n;return Object.assign(Object.assign({},null!=t?t:{}),{isAsyncStorageReady:!1,asyncStorageKey:null!==(n=null===(r=e.asyncStorage)||void 0===r?void 0:r.key)&&void 0!==n?n:null})})),e.constructor!==f?s(e):(e.initialize(),e)}return e=f,o&&n(e.prototype,o),a&&n(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}(h.GlobalStoreAbstract);t.GlobalStore=g,g.isAsyncStorageAvailable=function(t){return Boolean(null==t?void 0:t.key)},t.default=g})(),i})()));
|
|
1
|
+
var t,e;t=this,e=(t,e,r)=>(()=>{"use strict";var n={493:e=>{e.exports=t},466:t=>{t.exports=e},413:t=>{t.exports=r}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}var i={};return(()=>{var t=i;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(){r=function(){return n};var t,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,a=Object.create(o.prototype),c=new G(n||[]);return i(a,"_invoke",{value:E(t,r,c)}),a}function y(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var p="suspendedStart",v="suspendedYield",g="executing",d="completed",b={};function m(){}function w(){}function S(){}var j={};f(j,u,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(R([])));O&&O!==o&&a.call(O,u)&&(j=O);var _=S.prototype=m.prototype=Object.create(j);function A(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,r){function n(o,i,c,u){var s=y(t[o],t,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(s.arg)}var o;i(this,"_invoke",{value:function(t,e){function a(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(a,a):a()}})}function E(e,r,n){var o=p;return function(a,i){if(o===g)throw new Error("Generator is already running");if(o===d){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var s=y(e,r,n);if("normal"===s.type){if(o=n.done?d:v,s.arg===b)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=d,n.method="throw",n.arg=s.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=y(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function R(r){if(r||""===r){var n=r[u];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function e(){for(;++o<r.length;)if(a.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(e(r)+" is not iterable")}return w.prototype=S,i(_,"constructor",{value:S,configurable:!0}),i(S,"constructor",{value:w,configurable:!0}),w.displayName=f(S,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,f(t,l,"GeneratorFunction")),t.prototype=Object.create(_),t},n.awrap=function(t){return{__await:t}},A(L.prototype),f(L.prototype,s,(function(){return this})),n.AsyncIterator=L,n.async=function(t,e,r,o,a){void 0===a&&(a=Promise);var i=new L(h(t,e,r,o),a);return n.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},A(_),f(_,l,"Generator"),f(_,u,(function(){return this})),f(_,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=R,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},n}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function o(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return c(t)}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStore=void 0;var s=a(413),l=a(493),f=a(466),h=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)}(h,t);var e,a,i,s=(a=h,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=u(a);if(i){var r=u(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return o(this,t)});function h(t){var e,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{metadata:{}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),(e=s.call(this,t,a)).asyncStorage=null,e.getMetadata=function(){var t,r;return(null===(t=e.asyncStorage)||void 0===t?void 0:t.key)?Object.assign({isAsyncStorageReady:!1,asyncStorageKey:e.asyncStorage.key},null!==(r=e.metadata)&&void 0!==r?r:{}):e.metadata},e._onInitialize=function(t){var n,o,a,i=t.setState,u=t.getState,s=t.setMetadata;return n=c(e),o=void 0,a=r().mark((function t(){var e;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(h.isAsyncStorageAvailable(this.asyncStorage)){t.next=2;break}return t.abrupt("return");case 2:return s((function(t){return Object.assign(Object.assign({},null!=t?t:{}),{isAsyncStorageReady:!1})})),t.next=5,(0,l.getAsyncStorageItem)(this.asyncStorage);case 5:e=t.sent,s((function(t){return Object.assign(Object.assign({},null!=t?t:{}),{isAsyncStorageReady:!0})})),null===e&&(e=u(),(0,f.setAsyncStorageItem)(e,this.asyncStorage)),i(e,{forceUpdate:!0});case 9:case"end":return t.stop()}}),t,this)})),new(o||(o=Promise))((function(t,e){function r(t){try{c(a.next(t))}catch(t){e(t)}}function i(t){try{c(a.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,i)}c((a=a.apply(n,[])).next())}))},e._onChange=function(t){var r=t.getState;h.isAsyncStorageAvailable(e.asyncStorage)&&(0,f.setAsyncStorageItem)(r(),e.asyncStorage)},e.onInitialize=null,e.onChange=null,e.onInit=function(t){var r;null===(r=e._onInitialize)||void 0===r||r.call(c(e),t)},e.onStateChanged=function(t){var r;null===(r=e._onChange)||void 0===r||r.call(c(e),t)},e.asyncStorage=null!==(n=a.asyncStorage)&&void 0!==n?n:null,e.setMetadata((function(t){var r,n;return Object.assign(Object.assign({},null!=t?t:{}),{isAsyncStorageReady:!1,asyncStorageKey:null!==(n=null===(r=e.asyncStorage)||void 0===r?void 0:r.key)&&void 0!==n?n:null})})),e.constructor!==h?o(e):(e.initialize(),e)}return e=h,Object.defineProperty(e,"prototype",{writable:!1}),e}(s.GlobalStoreAbstract);t.GlobalStore=h,h.isAsyncStorageAvailable=function(t){return Boolean(null==t?void 0:t.key)},t.default=h})(),i})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("./getAsyncStorageItem.js"),require("./setAsyncStorageItem.js"),require("react-hooks-global-states/GlobalStoreAbstract")):"function"==typeof define&&define.amd?define(["./getAsyncStorageItem.js","./setAsyncStorageItem.js","react-hooks-global-states/GlobalStoreAbstract"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("./getAsyncStorageItem.js"),require("./setAsyncStorageItem.js"),require("react-hooks-global-states/GlobalStoreAbstract")):t["react-native-global-state-hooks"]=e(t["./getAsyncStorageItem.js"],t["./setAsyncStorageItem.js"],t["react-hooks-global-states/GlobalStoreAbstract"]);
|
package/GlobalStoreAbstract.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var t;t=t=>(()=>{"use strict";var e={352:e=>{e.exports=t}},o={};function r(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,r),i.exports}var n={};return(()=>{var t=n;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStoreAbstract=void 0;var u=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(l,t);var r,n,u,f=(n=l,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,o=c(n);if(u){var r=c(this).constructor;t=Reflect.construct(o,arguments,r)}else t=o.apply(this,arguments);return function(t,o){if(o&&("object"===e(o)||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return i(t)}(this,t)});function l(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(t=f.apply(this,arguments)).onInit=function(e){var o;t._onInitialize(e),null===(o=t.onInitialize)||void 0===o||o.call(i(t),e)},t.onStateChanged=function(e){var o;t._onInitialize(e),null===(o=t.onChange)||void 0===o||o.call(i(t),e)},t}return r=l,Object.defineProperty(r,"prototype",{writable:!1}),r}(r(352).GlobalStore);t.GlobalStoreAbstract=u,t.default=u})(),n})(),"object"==typeof exports&&"object"==typeof module?module.exports=t(require("./GlobalStore.js")):"function"==typeof define&&define.amd?define(["./GlobalStore.js"],t):"object"==typeof exports?exports["react-native-global-state-hooks"]=t(require("./GlobalStore.js")):this["react-native-global-state-hooks"]=t(this["./GlobalStore.js"]);
|
package/asyncStorageWrapper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@react-native-async-storage/async-storage")):"function"==typeof define&&define.amd?define(["@react-native-async-storage/async-storage"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("@react-native-async-storage/async-storage")):t["react-native-global-state-hooks"]=e(t["@react-native-async-storage/async-storage"])}(this,(t=>(()=>{"use strict";var e={118:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){o=function(){return e};var t,e={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,a=Object.create(o.prototype),c=new G(n||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var v="suspendedStart",y="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var L={};l(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(M([])));E&&E!==r&&a.call(E,u)&&(L=E);var O=x.prototype=w.prototype=Object.create(L);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,c,u){var s=p(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&a.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(l).then((function(t){f.value=t,c(f)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var o;i(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}})}function S(e,r,n){var o=v;return function(a,i){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?g:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return b.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(k.prototype),l(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new k(h(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(O),l(O,f,"Generator"),l(O,u,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=M,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}var a=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]},i=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&a(e,t,r);return i(e,t),e},u=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,c)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.asyncStorageWrapper=void 0,e.asyncStorageWrapper=function(){var t,e="pending",n=null;u(void 0,void 0,void 0,o().mark((function a(){var i,u,s,f,l;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,i=Promise.resolve().then((function(){return c(r(878))})),t=i,o.next=5,i;case 5:u=o.sent,s=u.default,f=s.getItem,l=s.setItem,f.bind(s),l.bind(s),n={getItem:f,setItem:l},e="resolved",o.next=18;break;case 14:o.prev=14,o.t0=o.catch(0),e="rejected";case 18:return o.prev=18,t=null,o.finish(18);case 21:case"end":return o.stop()}}),a,null,[[0,14,18,21]])})));var a=function(){throw new Error("[AsyncStorageManager Not Found] \n\n Please install the react-native-async-storage/async-storage to be use as the default async storage manager or\n add an AsyncStorageManager using the asyncStorageWrapper.addAsyncStorageManager method before attempting to get or set items.")},i=function(){return u(void 0,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("pending"!==e||!t){r.next=2;break}return r.abrupt("return",t);case 2:if("rejected"!==e){r.next=4;break}return r.abrupt("return",t.catch((function(t){throw t})));case 4:return n||a(),r.abrupt("return",n);case 6:case"end":return r.stop()}}),r)})))};return{getItem:function(t){return u(void 0,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i();case 2:return e.abrupt("return",n.getItem(t));case 3:case"end":return e.stop()}}),e)})))},setItem:function(t,e){return u(void 0,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,i();case 2:return r.abrupt("return",n.setItem(t,e));case 3:case"end":return r.stop()}}),r)})))},addAsyncStorageManager:function(r){return u(void 0,void 0,void 0,o().mark((function a(){var i;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,"pending"!==e||!t){o.next=4;break}return o.next=4,t.catch((function(){}));case 4:return e="pending",i=r(),t=i,o.next=9,i;case 9:n=o.sent,e="resolved",o.next=18;break;case 13:throw o.prev=13,o.t0=o.catch(0),t=null,e="rejected",o.t0;case 18:case"end":return o.stop()}}),a,null,[[0,13]])})))}}}(),e.default=e.asyncStorageWrapper},878:e=>{e.exports=t}},r={};var n=function t(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={exports:{}};return e[n](a,a.exports,t),a.exports}(118);return n})()));
|
|
1
|
+
var t;t=t=>(()=>{"use strict";var e={118:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){o=function(){return e};var t,e={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,a=Object.create(o.prototype),c=new G(n||[]);return i(a,"_invoke",{value:S(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var v="suspendedStart",y="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var L={};l(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(M([])));E&&E!==r&&a.call(E,u)&&(L=E);var O=x.prototype=w.prototype=Object.create(L);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,i,c,u){var s=p(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&a.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(l).then((function(t){f.value=t,c(f)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var o;i(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}})}function S(e,r,n){var o=v;return function(a,i){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=p(e,r,n);if("normal"===s.type){if(o=n.done?g:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,m;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return b.prototype=x,i(O,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,f,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},_(k.prototype),l(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new k(h(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(O),l(O,f,"Generator"),l(O,u,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=M,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}var a=Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]},i=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&a(e,t,r);return i(e,t),e},u=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,c)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.asyncStorageWrapper=void 0,e.asyncStorageWrapper=function(){var t,e="pending",n=null;u(void 0,void 0,void 0,o().mark((function a(){var i,u,s,f,l;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,i=Promise.resolve().then((function(){return c(r(878))})),t=i,o.next=5,i;case 5:u=o.sent,s=u.default,f=s.getItem,l=s.setItem,f.bind(s),l.bind(s),n={getItem:f,setItem:l},e="resolved",o.next=18;break;case 14:o.prev=14,o.t0=o.catch(0),e="rejected";case 18:return o.prev=18,t=null,o.finish(18);case 21:case"end":return o.stop()}}),a,null,[[0,14,18,21]])})));var a=function(){throw new Error("[AsyncStorageManager Not Found] \n\n Please install the react-native-async-storage/async-storage to be use as the default async storage manager or\n add an AsyncStorageManager using the asyncStorageWrapper.addAsyncStorageManager method before attempting to get or set items.")},i=function(){return u(void 0,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("pending"!==e||!t){r.next=2;break}return r.abrupt("return",t);case 2:if("rejected"!==e){r.next=4;break}return r.abrupt("return",t.catch((function(t){throw t})));case 4:return n||a(),r.abrupt("return",n);case 6:case"end":return r.stop()}}),r)})))};return{getItem:function(t){return u(void 0,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i();case 2:return e.abrupt("return",n.getItem(t));case 3:case"end":return e.stop()}}),e)})))},setItem:function(t,e){return u(void 0,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,i();case 2:return r.abrupt("return",n.setItem(t,e));case 3:case"end":return r.stop()}}),r)})))},addAsyncStorageManager:function(r){return u(void 0,void 0,void 0,o().mark((function a(){var i;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,"pending"!==e||!t){o.next=4;break}return o.next=4,t.catch((function(){}));case 4:return e="pending",i=r(),t=i,o.next=9,i;case 9:n=o.sent,e="resolved",o.next=18;break;case 13:throw o.prev=13,o.t0=o.catch(0),t=null,e="rejected",o.t0;case 18:case"end":return o.stop()}}),a,null,[[0,13]])})))}}}(),e.default=e.asyncStorageWrapper},878:e=>{e.exports=t}},r={};return function t(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={exports:{}};return e[n](a,a.exports,t),a.exports}(118)})(),"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@react-native-async-storage/async-storage")):"function"==typeof define&&define.amd?define(["@react-native-async-storage/async-storage"],t):"object"==typeof exports?exports["react-native-global-state-hooks"]=t(require("@react-native-async-storage/async-storage")):this["react-native-global-state-hooks"]=t(this["@react-native-async-storage/async-storage"]);
|
package/bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e,t;e=this,t=(e,t,r,o,a,n,s,u,l,c,i,b,j,S,g)=>(()=>{"use strict";var p={352:t=>{t.exports=e},674:e=>{e.exports=t},390:e=>{e.exports=r},104:e=>{e.exports=o},842:e=>{e.exports=a},963:e=>{e.exports=n},109:e=>{e.exports=s},493:e=>{e.exports=u},664:e=>{e.exports=l},466:e=>{e.exports=c},682:e=>{e.exports=i},286:e=>{e.exports=b},865:e=>{e.exports=j},69:e=>{e.exports=S},503:e=>{e.exports=g}},y={};function m(e){var t=y[e];if(void 0!==t)return t.exports;var r=y[e]={exports:{}};return p[e](r,r.exports,m),r.exports}var f={};return(()=>{var e=f;Object.defineProperty(e,"__esModule",{value:!0}),e.generateStackHash=e.asyncStorageWrapper=e.setAsyncStorageItem=e.getAsyncStorageItem=e.createCustomGlobalState=e.createGlobalState=e.GlobalStoreAbstract=e.GlobalStore=e.createContext=e.useStableState=e.uniqueSymbol=e.isRecord=e.throwWrongKeyOnActionCollectionConfig=e.uniqueId=e.shallowCompare=void 0;var t=m(682);Object.defineProperty(e,"shallowCompare",{enumerable:!0,get:function(){return t.shallowCompare}});var r=m(865);Object.defineProperty(e,"uniqueId",{enumerable:!0,get:function(){return r.uniqueId}});var o=m(286);Object.defineProperty(e,"throwWrongKeyOnActionCollectionConfig",{enumerable:!0,get:function(){return o.throwWrongKeyOnActionCollectionConfig}});var a=m(664);Object.defineProperty(e,"isRecord",{enumerable:!0,get:function(){return a.isRecord}});var n=m(69);Object.defineProperty(e,"uniqueSymbol",{enumerable:!0,get:function(){return n.uniqueSymbol}});var s=m(503);Object.defineProperty(e,"useStableState",{enumerable:!0,get:function(){return s.useStableState}});var u=m(104);Object.defineProperty(e,"createContext",{enumerable:!0,get:function(){return u.createContext}});var l=m(352);Object.defineProperty(e,"GlobalStore",{enumerable:!0,get:function(){return l.GlobalStore}});var c=m(674);Object.defineProperty(e,"GlobalStoreAbstract",{enumerable:!0,get:function(){return c.GlobalStoreAbstract}});var i=m(963);Object.defineProperty(e,"createGlobalState",{enumerable:!0,get:function(){return i.createGlobalState}});var b=m(842);Object.defineProperty(e,"createCustomGlobalState",{enumerable:!0,get:function(){return b.createCustomGlobalState}});var j=m(493);Object.defineProperty(e,"getAsyncStorageItem",{enumerable:!0,get:function(){return j.getAsyncStorageItem}});var S=m(466);Object.defineProperty(e,"setAsyncStorageItem",{enumerable:!0,get:function(){return S.setAsyncStorageItem}});var g=m(390);Object.defineProperty(e,"asyncStorageWrapper",{enumerable:!0,get:function(){return g.asyncStorageWrapper}});var p=m(109);Object.defineProperty(e,"generateStackHash",{enumerable:!0,get:function(){return p.generateStackHash}})})(),f})(),"object"==typeof exports&&"object"==typeof module?module.exports=t(require("./GlobalStore.js"),require("./GlobalStoreAbstract.js"),require("./asyncStorageWrapper.js"),require("./createContext.js"),require("./createCustomGlobalState.js"),require("./createGlobalState.js"),require("./generateStackHash.js"),require("./getAsyncStorageItem.js"),require("./isRecord.js"),require("./setAsyncStorageItem.js"),require("./shallowCompare.js"),require("./throwWrongKeyOnActionCollectionConfig.js"),require("./uniqueId.js"),require("./uniqueSymbol.js"),require("./useStableState.js")):"function"==typeof define&&define.amd?define(["./GlobalStore.js","./GlobalStoreAbstract.js","./asyncStorageWrapper.js","./createContext.js","./createCustomGlobalState.js","./createGlobalState.js","./generateStackHash.js","./getAsyncStorageItem.js","./isRecord.js","./setAsyncStorageItem.js","./shallowCompare.js","./throwWrongKeyOnActionCollectionConfig.js","./uniqueId.js","./uniqueSymbol.js","./useStableState.js"],t):"object"==typeof exports?exports["react-native-global-state-hooks"]=t(require("./GlobalStore.js"),require("./GlobalStoreAbstract.js"),require("./asyncStorageWrapper.js"),require("./createContext.js"),require("./createCustomGlobalState.js"),require("./createGlobalState.js"),require("./generateStackHash.js"),require("./getAsyncStorageItem.js"),require("./isRecord.js"),require("./setAsyncStorageItem.js"),require("./shallowCompare.js"),require("./throwWrongKeyOnActionCollectionConfig.js"),require("./uniqueId.js"),require("./uniqueSymbol.js"),require("./useStableState.js")):e["react-native-global-state-hooks"]=t(e["./GlobalStore.js"],e["./GlobalStoreAbstract.js"],e["./asyncStorageWrapper.js"],e["./createContext.js"],e["./createCustomGlobalState.js"],e["./createGlobalState.js"],e["./generateStackHash.js"],e["./getAsyncStorageItem.js"],e["./isRecord.js"],e["./setAsyncStorageItem.js"],e["./shallowCompare.js"],e["./throwWrongKeyOnActionCollectionConfig.js"],e["./uniqueId.js"],e["./uniqueSymbol.js"],e["./useStableState.js"]);
|
package/createContext.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={671:t=>{t.exports=e}},o={};function r(e){var a=o[e];if(void 0!==a)return a.exports;var s=o[e]={exports:{}};return t[e](s,s.exports,r),s.exports}var a={};return(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.createContext=void 0;var t=r(671);Object.defineProperty(e,"createContext",{enumerable:!0,get:function(){return t.createContext}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})})(),a})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/createContext")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/createContext"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("react-hooks-global-states/createContext")):this["react-native-global-state-hooks"]=e(this["react-hooks-global-states/createContext"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={362:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createCustomGlobalState=void 0;var a=o(963);t.createCustomGlobalState=function(e){var t=e.onInitialize,o=e.onChange;return function(e){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.callbacks,r=function(e,t){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(o[a[l]]=e[a[l]])}return o}(l,["callbacks"]);return(0,a.createGlobalState)(e,Object.assign(Object.assign({},r),{callbacks:Object.assign(Object.assign({},null!=n?n:{}),{onInit:function(e){var o;null==t||t(e,null==r?void 0:r.config),null===(o=null==n?void 0:n.onInit)||void 0===o||o.call(n,e)},onStateChanged:function(e){var t;null==o||o(e,null==r?void 0:r.config),null===(t=null==n?void 0:n.onStateChanged)||void 0===t||t.call(n,e)}})}))}},t.default=t.createCustomGlobalState},963:t=>{t.exports=e}},o={};return function e(a){var l=o[a];if(void 0!==l)return l.exports;var n=o[a]={exports:{}};return t[a](n,n.exports,e),n.exports}(362)})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("./createGlobalState.js")):"function"==typeof define&&define.amd?define(["./createGlobalState.js"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("./createGlobalState.js")):this["react-native-global-state-hooks"]=e(this["./createGlobalState.js"]);
|
package/createGlobalState.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={196:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createGlobalState=void 0;var r=o(352);t.createGlobalState=function(e,t){return new r.GlobalStore(e,t).getHook()},t.default=t.createGlobalState},352:t=>{t.exports=e}},o={};return function e(r){var a=o[r];if(void 0!==a)return a.exports;var l=o[r]={exports:{}};return t[r](l,l.exports,e),l.exports}(196)})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("./GlobalStore.js")):"function"==typeof define&&define.amd?define(["./GlobalStore.js"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("./GlobalStore.js")):this["react-native-global-state-hooks"]=e(this["./GlobalStore.js"]);
|
package/generateStackHash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={553:t=>{t.exports=e}},a={};function r(e){var o=a[e];if(void 0!==o)return o.exports;var s=a[e]={exports:{}};return t[e](s,s.exports,r),s.exports}var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.generateStackHash=void 0;var t=r(553);Object.defineProperty(e,"generateStackHash",{enumerable:!0,get:function(){return t.generateStackHash}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})})(),o})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/generateStackHash")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/generateStackHash"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("react-hooks-global-states/generateStackHash")):this["react-native-global-state-hooks"]=e(this["react-hooks-global-states/generateStackHash"]);
|
package/getAsyncStorageItem.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var t,r;t=this,r=(t,r)=>(()=>{"use strict";var e={600:(t,r,e)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){o=function(){return r};var t,r={},e=Object.prototype,a=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",f=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof w?r:w,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:k(t,e,c)}),a}function p(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",g="completed",m={};function w(){}function b(){}function x(){}var L={};l(L,u,(function(){return this}));var j=Object.getPrototypeOf,S=j&&j(j(I([])));S&&S!==e&&a.call(S,u)&&(L=S);var E=x.prototype=w.prototype=Object.create(L);function _(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function O(t,r){function e(o,i,c,u){var f=p(t[o],t,i);if("throw"!==f.type){var s=f.arg,l=s.value;return l&&"object"==n(l)&&a.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,c,u)}),(function(t){e("throw",t,c,u)})):r.resolve(l).then((function(t){s.value=t,c(s)}),(function(t){return e("throw",t,c,u)}))}u(f.arg)}var o;i(this,"_invoke",{value:function(t,n){function a(){return new r((function(r,o){e(t,n,r,o)}))}return o=o?o.then(a,a):a()}})}function k(r,e,n){var o=y;return function(a,i){if(o===d)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=F(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var f=p(r,e,n);if("normal"===f.type){if(o=n.done?g:v,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=g,n.method="throw",n.arg=f.arg)}}}function F(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,F(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var a=p(o,r.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,m;var i=a.arg;return i?i.done?(e[r.resultName]=i.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function P(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function G(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function I(r){if(r||""===r){var e=r[u];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function e(){for(;++o<r.length;)if(a.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(n(r)+" is not iterable")}return b.prototype=x,i(E,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=l(x,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},_(O.prototype),l(O.prototype,f,(function(){return this})),r.AsyncIterator=O,r.async=function(t,e,n,o,a){void 0===a&&(a=Promise);var i=new O(h(t,e,n,o),a);return r.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(E),l(E,s,"Generator"),l(E,u,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=I,N.prototype={constructor:N,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(G),!r)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),f=a.call(i,"finallyLoc");if(u&&f){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=r,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),G(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;G(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:I(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}Object.defineProperty(r,"__esModule",{value:!0}),r.getAsyncStorageItem=void 0;var a=e(390),i=e(89);r.getAsyncStorageItem=function(t){return r=void 0,e=o().mark((function r(){var e,n,c,u,f;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=t.key){r.next=3;break}return r.abrupt("return",null);case 3:return n="function"==typeof e?e():e,r.next=6,a.asyncStorageWrapper.getItem(n);case 6:if(null!==(c=r.sent)){r.next=9;break}return r.abrupt("return",null);case 9:return u=t.decrypt||t.encrypt?"function"==typeof t.decrypt?t.decrypt(c):atob(c):c,f=(0,i.formatFromStore)(u,{jsonParse:!0}),r.abrupt("return",f);case 12:case"end":return r.stop()}}),r)})),new(r||(r=Promise))((function(t,n){function o(t){try{i(e.next(t))}catch(t){n(t)}}function a(t){try{i(e.throw(t))}catch(t){n(t)}}function i(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,a)}i((e=e.apply(void 0,[])).next())}));var r,e},r.default=r.getAsyncStorageItem},390:r=>{r.exports=t},89:t=>{t.exports=r}},n={};return function t(r){var o=n[r];if(void 0!==o)return o.exports;var a=n[r]={exports:{}};return e[r](a,a.exports,t),a.exports}(600)})(),"object"==typeof exports&&"object"==typeof module?module.exports=r(require("./asyncStorageWrapper.js"),require("json-storage-formatter/formatFromStore")):"function"==typeof define&&define.amd?define(["./asyncStorageWrapper.js","json-storage-formatter/formatFromStore"],r):"object"==typeof exports?exports["react-native-global-state-hooks"]=r(require("./asyncStorageWrapper.js"),require("json-storage-formatter/formatFromStore")):t["react-native-global-state-hooks"]=r(t["./asyncStorageWrapper.js"],t["json-storage-formatter/formatFromStore"]);
|
package/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export type { StateSetter, HookExtensions, ObservableFragment, MetadataSetter, StateChanges, StoreTools, ActionCollectionResult, GlobalStoreCallbacks, UseHookConfig, UnsubscribeCallback, SubscribeCallbackConfig, SubscribeCallback, StateGetter, BaseMetadata, MetadataGetter, CustomGlobalHookBuilderParams, SelectorCallback, SubscriberParameters, SubscriptionCallback, StateHook, ActionCollectionConfig, StateMeta, } from "./types";
|
|
6
6
|
export { shallowCompare } from "./shallowCompare";
|
|
7
|
-
export { debounce } from "./debounce";
|
|
8
7
|
export { uniqueId } from "./uniqueId";
|
|
9
8
|
export { throwWrongKeyOnActionCollectionConfig } from "./throwWrongKeyOnActionCollectionConfig";
|
|
10
9
|
export { isRecord } from "./isRecord";
|
package/isRecord.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={414:t=>{t.exports=e}},o={};function r(e){var s=o[e];if(void 0!==s)return s.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,r),a.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.isRecord=void 0;var t=r(414);Object.defineProperty(e,"isRecord",{enumerable:!0,get:function(){return t.isRecord}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})})(),s})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/isRecord")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/isRecord"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("react-hooks-global-states/isRecord")):this["react-native-global-state-hooks"]=e(this["react-hooks-global-states/isRecord"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-global-state-hooks",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "This is a package to easily handling global-state across your react-native-components No-redux... The library now includes @react-native-async-storage/async-storage to persist your state across sessions... if you want to keep using the old version without async-storage or react-native dependencies just use version 5.0.15 or user react-hooks-global-states instead",
|
|
5
5
|
"main": "./bundle.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"require": "./createGlobalState.js",
|
|
32
32
|
"types": "./createGlobalState.d.ts"
|
|
33
33
|
},
|
|
34
|
-
"./
|
|
35
|
-
"import": "./
|
|
36
|
-
"require": "./
|
|
37
|
-
"types": "./
|
|
34
|
+
"./generateStackHash": {
|
|
35
|
+
"import": "./generateStackHash.js",
|
|
36
|
+
"require": "./generateStackHash.js",
|
|
37
|
+
"types": "./generateStackHash.d.ts"
|
|
38
38
|
},
|
|
39
39
|
"./getAsyncStorageItem": {
|
|
40
40
|
"import": "./getAsyncStorageItem.js",
|
|
@@ -169,6 +169,6 @@
|
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
171
|
"dependencies": {
|
|
172
|
-
"react-hooks-global-states": "^
|
|
172
|
+
"react-hooks-global-states": "^8.0.0"
|
|
173
173
|
}
|
|
174
174
|
}
|
package/setAsyncStorageItem.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e,t;e=this,t=(e,t)=>(()=>{"use strict";var r={305:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setAsyncStorageItem=void 0;var o=r(888),a=r(390);t.setAsyncStorageItem=function(e,t){var r=t.key;if(r){var s="function"==typeof r?r():r,n=(0,o.formatToStore)(e,{stringify:!0,excludeTypes:["function"]}),p=t.encrypt?"function"==typeof t.encrypt?t.encrypt(n):btoa(n):n;a.asyncStorageWrapper.setItem(s,p)}},t.default=t.setAsyncStorageItem},390:t=>{t.exports=e},888:e=>{e.exports=t}},o={};return function e(t){var a=o[t];if(void 0!==a)return a.exports;var s=o[t]={exports:{}};return r[t](s,s.exports,e),s.exports}(305)})(),"object"==typeof exports&&"object"==typeof module?module.exports=t(require("./asyncStorageWrapper.js"),require("json-storage-formatter/formatToStore")):"function"==typeof define&&define.amd?define(["./asyncStorageWrapper.js","json-storage-formatter/formatToStore"],t):"object"==typeof exports?exports["react-native-global-state-hooks"]=t(require("./asyncStorageWrapper.js"),require("json-storage-formatter/formatToStore")):e["react-native-global-state-hooks"]=t(e["./asyncStorageWrapper.js"],e["json-storage-formatter/formatToStore"]);
|
package/shallowCompare.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var o={245:o=>{o.exports=e}},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var s=t[e]={exports:{}};return o[e](s,s.exports,r),s.exports}var a={};return(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.shallowCompare=void 0;var o=r(245);Object.defineProperty(e,"shallowCompare",{enumerable:!0,get:function(){return o.shallowCompare}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=o,e&&e.__esModule?e:{default:e}).default;var e}})})(),a})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/shallowCompare")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/shallowCompare"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("react-hooks-global-states/shallowCompare")):this["react-native-global-state-hooks"]=e(this["react-hooks-global-states/shallowCompare"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var o={916:o=>{o.exports=e}},t={};function r(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return o[e](i,i.exports,r),i.exports}var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.throwWrongKeyOnActionCollectionConfig=void 0;var o=r(916);Object.defineProperty(e,"throwWrongKeyOnActionCollectionConfig",{enumerable:!0,get:function(){return o.throwWrongKeyOnActionCollectionConfig}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=o,e&&e.__esModule?e:{default:e}).default;var e}})})(),n})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/throwWrongKeyOnActionCollectionConfig")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/throwWrongKeyOnActionCollectionConfig"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("react-hooks-global-states/throwWrongKeyOnActionCollectionConfig")):this["react-native-global-state-hooks"]=e(this["react-hooks-global-states/throwWrongKeyOnActionCollectionConfig"]);
|
package/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0})})(),e})(),"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e():this["react-native-global-state-hooks"]=e();
|
package/uniqueId.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={32:t=>{t.exports=e}},o={};function r(e){var u=o[e];if(void 0!==u)return u.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,r),a.exports}var u={};return(()=>{var e=u;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.uniqueId=void 0;var t=r(32);Object.defineProperty(e,"uniqueId",{enumerable:!0,get:function(){return t.uniqueId}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})})(),u})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/uniqueId")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/uniqueId"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("react-hooks-global-states/uniqueId")):this["react-native-global-state-hooks"]=e(this["react-hooks-global-states/uniqueId"]);
|
package/uniqueSymbol.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={931:t=>{t.exports=e}},o={};function r(e){var u=o[e];if(void 0!==u)return u.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,r),a.exports}var u={};return(()=>{var e=u;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.uniqueSymbol=void 0;var t=r(931);Object.defineProperty(e,"uniqueSymbol",{enumerable:!0,get:function(){return t.uniqueSymbol}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})})(),u})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/uniqueSymbol")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/uniqueSymbol"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("react-hooks-global-states/uniqueSymbol")):this["react-native-global-state-hooks"]=e(this["react-hooks-global-states/uniqueSymbol"]);
|
package/useStableState.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e;e=e=>(()=>{"use strict";var t={439:t=>{t.exports=e}},a={};function o(e){var r=a[e];if(void 0!==r)return r.exports;var s=a[e]={exports:{}};return t[e](s,s.exports,o),s.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.useStableState=void 0;var t=o(439);Object.defineProperty(e,"useStableState",{enumerable:!0,get:function(){return t.useStableState}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return(e=t,e&&e.__esModule?e:{default:e}).default;var e}})})(),r})(),"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-hooks-global-states/useStableState")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/useStableState"],e):"object"==typeof exports?exports["react-native-global-state-hooks"]=e(require("react-hooks-global-states/useStableState")):this["react-native-global-state-hooks"]=e(this["react-hooks-global-states/useStableState"]);
|
package/webpack.config.js
CHANGED
|
@@ -9,7 +9,6 @@ const individualEntries = {
|
|
|
9
9
|
createCustomGlobalState: "./src/createCustomGlobalState.ts",
|
|
10
10
|
createGlobalState: "./src/createGlobalState.ts",
|
|
11
11
|
types: "./src/types.ts",
|
|
12
|
-
debounce: "./src/debounce.ts",
|
|
13
12
|
isRecord: "./src/isRecord.ts",
|
|
14
13
|
shallowCompare: "./src/shallowCompare.ts",
|
|
15
14
|
throwWrongKeyOnActionCollectionConfig: "./src/throwWrongKeyOnActionCollectionConfig.ts",
|
|
@@ -114,6 +113,21 @@ module.exports = {
|
|
|
114
113
|
new TerserPlugin({
|
|
115
114
|
extractComments: false,
|
|
116
115
|
terserOptions: {
|
|
116
|
+
compress: {
|
|
117
|
+
passes: 5,
|
|
118
|
+
drop_console: true,
|
|
119
|
+
drop_debugger: true,
|
|
120
|
+
keep_fargs: false,
|
|
121
|
+
keep_infinity: true,
|
|
122
|
+
reduce_funcs: true,
|
|
123
|
+
reduce_vars: true,
|
|
124
|
+
keep_fnames: false,
|
|
125
|
+
toplevel: true,
|
|
126
|
+
},
|
|
127
|
+
mangle: {
|
|
128
|
+
toplevel: true,
|
|
129
|
+
properties: false,
|
|
130
|
+
},
|
|
117
131
|
format: {
|
|
118
132
|
comments: false,
|
|
119
133
|
},
|
package/debounce.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { debounce, default } from "react-hooks-global-states/debounce";
|
package/debounce.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-hooks-global-states/debounce")):"function"==typeof define&&define.amd?define(["react-hooks-global-states/debounce"],t):"object"==typeof exports?exports["react-native-global-state-hooks"]=t(require("react-hooks-global-states/debounce")):e["react-native-global-state-hooks"]=t(e["react-hooks-global-states/debounce"])}(this,(e=>(()=>{"use strict";var t={143:t=>{t.exports=e}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,r),a.exports}var n={};return(()=>{var e=n,t=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.debounce=void 0;var o=r(143);Object.defineProperty(e,"debounce",{enumerable:!0,get:function(){return o.debounce}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t(o).default}})})(),n})()));
|