@tamagui/use-store 3.0.0-beta.669.1 → 3.0.0-beta.728.1
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/dist/cjs/comparators.cjs +0 -1
- package/dist/cjs/comparators.native.cjs +0 -1
- package/dist/cjs/comparators.native.js +0 -1
- package/dist/cjs/comparators.native.js.map +1 -1
- package/dist/cjs/configureUseStore.cjs +0 -1
- package/dist/cjs/configureUseStore.native.cjs +0 -1
- package/dist/cjs/configureUseStore.native.js +0 -1
- package/dist/cjs/configureUseStore.native.js.map +1 -1
- package/dist/cjs/constants.cjs +0 -1
- package/dist/cjs/constants.native.cjs +0 -1
- package/dist/cjs/constants.native.js +0 -1
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/decorators.cjs +0 -1
- package/dist/cjs/decorators.native.cjs +0 -1
- package/dist/cjs/decorators.native.js +0 -1
- package/dist/cjs/decorators.native.js.map +1 -1
- package/dist/cjs/helpers.cjs +0 -1
- package/dist/cjs/helpers.native.cjs +0 -1
- package/dist/cjs/helpers.native.js +0 -1
- package/dist/cjs/helpers.native.js.map +1 -1
- package/dist/cjs/index.cjs +0 -1
- package/dist/cjs/index.native.cjs +0 -1
- package/dist/cjs/index.native.js +0 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/interfaces.cjs +0 -1
- package/dist/cjs/interfaces.native.cjs +0 -1
- package/dist/cjs/interfaces.native.js +0 -1
- package/dist/cjs/interfaces.native.js.map +1 -1
- package/dist/cjs/observe.cjs +0 -1
- package/dist/cjs/observe.native.cjs +0 -1
- package/dist/cjs/observe.native.js +0 -1
- package/dist/cjs/observe.native.js.map +1 -1
- package/dist/cjs/useStore.cjs +0 -1
- package/dist/cjs/useStore.native.cjs +0 -1
- package/dist/cjs/useStore.native.js +0 -1
- package/dist/cjs/useStore.native.js.map +1 -1
- package/dist/cjs/useStoreDebug.cjs +0 -1
- package/dist/cjs/useStoreDebug.native.cjs +0 -1
- package/dist/cjs/useStoreDebug.native.js +0 -1
- package/dist/cjs/useStoreDebug.native.js.map +1 -1
- package/dist/esm/decorators.mjs.map +1 -1
- package/dist/esm/decorators.native.js.map +1 -1
- package/dist/esm/observe.mjs.map +1 -1
- package/dist/esm/observe.native.js.map +1 -1
- package/dist/esm/useStore.mjs.map +1 -1
- package/dist/esm/useStore.native.js.map +1 -1
- package/dist/esm/useStoreDebug.mjs.map +1 -1
- package/package.json +4 -4
package/dist/cjs/comparators.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparators.native.js","names":[],"sources":["cjs/comparators.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar comparators_exports = {};\n__export(comparators_exports, {\n isEqualSubsetShallow: () => isEqualSubsetShallow\n});\nmodule.exports = __toCommonJS(comparators_exports);\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar isEqualSubsetShallow = function(a, b, opts) {\n if (b == null || a == null) return a === b;\n if ((typeof a === \"undefined\" ? \"undefined\" : _type_of(a)) !== (typeof b === \"undefined\" ? \"undefined\" : _type_of(b))) return false;\n if ((typeof b === \"undefined\" ? \"undefined\" : _type_of(b)) === \"object\") {\n for (var key in b) {\n var _opts_keyComparators;\n var compare = opts === null || opts === void 0 ? void 0 : (_opts_keyComparators = opts.keyComparators) === null || _opts_keyComparators === void 0 ? void 0 : _opts_keyComparators[key];\n if (compare ? !compare(a[key], b[key]) : b[key] !== a[key]) {\n return false;\n }\n }\n return true;\n }\n return a === b;\n};\n//# sourceMappingURL=comparators.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"comparators.native.js","names":[],"sources":["cjs/comparators.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar comparators_exports = {};\n__export(comparators_exports, {\n isEqualSubsetShallow: () => isEqualSubsetShallow\n});\nmodule.exports = __toCommonJS(comparators_exports);\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar isEqualSubsetShallow = function(a, b, opts) {\n if (b == null || a == null) return a === b;\n if ((typeof a === \"undefined\" ? \"undefined\" : _type_of(a)) !== (typeof b === \"undefined\" ? \"undefined\" : _type_of(b))) return false;\n if ((typeof b === \"undefined\" ? \"undefined\" : _type_of(b)) === \"object\") {\n for (var key in b) {\n var _opts_keyComparators;\n var compare = opts === null || opts === void 0 ? void 0 : (_opts_keyComparators = opts.keyComparators) === null || _opts_keyComparators === void 0 ? void 0 : _opts_keyComparators[key];\n if (compare ? !compare(a[key], b[key]) : b[key] !== a[key]) {\n return false;\n }\n }\n return true;\n }\n return a === b;\n};\n//# sourceMappingURL=comparators.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB,EAC5B,4BAA4B,qBAC9B,CAAC;AACD,OAAO,UAAU,aAAa,mBAAmB;AACjD,SAAS,SAAS,KAAK;CACrB;CACA,OAAO,OAAO,OAAO,WAAW,eAAe,IAAI,gBAAgB,SAAS,WAAW,OAAO;AAChG;AACA,IAAI,uBAAuB,SAAS,GAAG,GAAG,MAAM;CAC9C,IAAI,KAAK,QAAQ,KAAK,MAAM,OAAO,MAAM;CACzC,KAAK,OAAO,MAAM,cAAc,cAAc,SAAS,CAAC,QAAQ,OAAO,MAAM,cAAc,cAAc,SAAS,CAAC,IAAI,OAAO;CAC9H,KAAK,OAAO,MAAM,cAAc,cAAc,SAAS,CAAC,OAAO,UAAU;EACvE,KAAK,IAAI,OAAO,GAAG;GACjB,IAAI;GACJ,IAAI,UAAU,SAAS,QAAQ,SAAS,KAAK,IAAI,KAAK,KAAK,uBAAuB,KAAK,oBAAoB,QAAQ,yBAAyB,KAAK,IAAI,KAAK,IAAI,qBAAqB;GACnL,IAAI,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,IAAI,EAAE,SAAS,EAAE,MAAM;IAC1D,OAAO;GACT;EACF;EACA,OAAO;CACT;CACA,OAAO,MAAM;AACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureUseStore.native.js","names":[],"sources":["cjs/configureUseStore.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar configureUseStore_exports = {};\n__export(configureUseStore_exports, {\n configureOpts: () => configureOpts,\n configureUseStore: () => configureUseStore\n});\nmodule.exports = __toCommonJS(configureUseStore_exports);\nvar configureOpts = {};\nfunction configureUseStore(opts) {\n configureOpts = opts;\n}\n//# sourceMappingURL=configureUseStore.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"configureUseStore.native.js","names":[],"sources":["cjs/configureUseStore.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar configureUseStore_exports = {};\n__export(configureUseStore_exports, {\n configureOpts: () => configureOpts,\n configureUseStore: () => configureUseStore\n});\nmodule.exports = __toCommonJS(configureUseStore_exports);\nvar configureOpts = {};\nfunction configureUseStore(opts) {\n configureOpts = opts;\n}\n//# sourceMappingURL=configureUseStore.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,4BAA4B,CAAC;AACjC,SAAS,2BAA2B;CAClC,qBAAqB;CACrB,yBAAyB;AAC3B,CAAC;AACD,OAAO,UAAU,aAAa,yBAAyB;AACvD,IAAI,gBAAgB,CAAC;AACrB,SAAS,kBAAkB,MAAM;CAC/B,gBAAgB;AAClB"}
|
package/dist/cjs/constants.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.native.js","names":[],"sources":["cjs/constants.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar constants_exports = {};\n__export(constants_exports, {\n UNWRAP_PROXY: () => UNWRAP_PROXY,\n defaultOptions: () => defaultOptions\n});\nmodule.exports = __toCommonJS(constants_exports);\nvar UNWRAP_PROXY = /* @__PURE__ */ Symbol();\nvar defaultOptions = {\n once: false,\n selector: void 0\n};\n//# sourceMappingURL=constants.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.native.js","names":[],"sources":["cjs/constants.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar constants_exports = {};\n__export(constants_exports, {\n UNWRAP_PROXY: () => UNWRAP_PROXY,\n defaultOptions: () => defaultOptions\n});\nmodule.exports = __toCommonJS(constants_exports);\nvar UNWRAP_PROXY = /* @__PURE__ */ Symbol();\nvar defaultOptions = {\n once: false,\n selector: void 0\n};\n//# sourceMappingURL=constants.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,oBAAoB,CAAC;AACzB,SAAS,mBAAmB;CAC1B,oBAAoB;CACpB,sBAAsB;AACxB,CAAC;AACD,OAAO,UAAU,aAAa,iBAAiB;AAC/C,IAAI,eAA+B,uBAAO;AAC1C,IAAI,iBAAiB;CACnB,MAAM;CACN,UAAU,KAAK;AACjB"}
|
package/dist/cjs/decorators.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.native.js","names":[],"sources":["cjs/decorators.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar decorators_exports = {};\n__export(decorators_exports, {\n compare: () => compare\n});\nmodule.exports = __toCommonJS(decorators_exports);\nfunction compare(comparator) {\n return function(target, propertyKey) {\n target[\"_comparators\"] = target[\"_comparators\"] || {};\n target[\"_comparators\"][propertyKey] = comparator;\n };\n}\n//# sourceMappingURL=decorators.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorators.native.js","names":[],"sources":["cjs/decorators.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar decorators_exports = {};\n__export(decorators_exports, {\n compare: () => compare\n});\nmodule.exports = __toCommonJS(decorators_exports);\nfunction compare(comparator) {\n return function(target, propertyKey) {\n target[\"_comparators\"] = target[\"_comparators\"] || {};\n target[\"_comparators\"][propertyKey] = comparator;\n };\n}\n//# sourceMappingURL=decorators.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,qBAAqB,CAAC;AAC1B,SAAS,oBAAoB,EAC3B,eAAe,QACjB,CAAC;AACD,OAAO,UAAU,aAAa,kBAAkB;AAChD,SAAS,QAAQ,YAAY;CAC3B,OAAO,SAAS,QAAQ,aAAa;EACnC,OAAO,kBAAkB,OAAO,mBAAmB,CAAC;EACpD,OAAO,eAAe,CAAC,eAAe;CACxC;AACF"}
|
package/dist/cjs/helpers.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.native.js","names":[],"sources":["cjs/helpers.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar helpers_exports = {};\n__export(helpers_exports, {\n UNWRAP_STORE_INFO: () => UNWRAP_STORE_INFO,\n cache: () => cache,\n get: () => get,\n getStoreDebugInfo: () => getStoreDebugInfo,\n getStoreDescriptors: () => getStoreDescriptors,\n getStoreUid: () => getStoreUid,\n simpleStr: () => simpleStr\n});\nmodule.exports = __toCommonJS(helpers_exports);\nvar import_simple_hash = require(\"@tamagui/simple-hash\");\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nfunction getStoreUid(Constructor, props) {\n return (0, import_simple_hash.simpleHash)(`${Constructor}${!props ? \"\" : typeof props === \"string\" ? props : JSON.stringify(props)}`, \"strict\");\n}\nvar UNWRAP_STORE_INFO = /* @__PURE__ */ Symbol(\"UNWRAP_STORE_INFO\");\nvar cache = /* @__PURE__ */ new Map();\nfunction getStoreDescriptors(storeInstance) {\n var proto = Object.getPrototypeOf(storeInstance);\n var instanceDescriptors = Object.getOwnPropertyDescriptors(storeInstance);\n var protoDescriptors = Object.getOwnPropertyDescriptors(proto);\n var descriptors = {\n ...protoDescriptors,\n ...instanceDescriptors\n };\n delete descriptors.constructor;\n return descriptors;\n}\nfunction get(_, b) {\n return _;\n}\nfunction simpleStr(arg) {\n if (process.env.NODE_ENV === \"development\") {\n return typeof arg === \"function\" ? \"fn\" : typeof arg === \"string\" ? `\"${arg}\"` : !arg ? arg : (typeof arg === \"undefined\" ? \"undefined\" : _type_of(arg)) !== \"object\" ? arg : Array.isArray(arg) ? \"[...]\" : `{...}`;\n }\n return arg;\n}\nfunction getStoreDebugInfo(store) {\n var _store_UNWRAP_STORE_INFO;\n return (_store_UNWRAP_STORE_INFO = store[UNWRAP_STORE_INFO]) !== null && _store_UNWRAP_STORE_INFO !== void 0 ? _store_UNWRAP_STORE_INFO : cache.get(getStoreUid(store.constructor, store.props));\n}\n//# sourceMappingURL=helpers.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.native.js","names":[],"sources":["cjs/helpers.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar helpers_exports = {};\n__export(helpers_exports, {\n UNWRAP_STORE_INFO: () => UNWRAP_STORE_INFO,\n cache: () => cache,\n get: () => get,\n getStoreDebugInfo: () => getStoreDebugInfo,\n getStoreDescriptors: () => getStoreDescriptors,\n getStoreUid: () => getStoreUid,\n simpleStr: () => simpleStr\n});\nmodule.exports = __toCommonJS(helpers_exports);\nvar import_simple_hash = require(\"@tamagui/simple-hash\");\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nfunction getStoreUid(Constructor, props) {\n return (0, import_simple_hash.simpleHash)(`${Constructor}${!props ? \"\" : typeof props === \"string\" ? props : JSON.stringify(props)}`, \"strict\");\n}\nvar UNWRAP_STORE_INFO = /* @__PURE__ */ Symbol(\"UNWRAP_STORE_INFO\");\nvar cache = /* @__PURE__ */ new Map();\nfunction getStoreDescriptors(storeInstance) {\n var proto = Object.getPrototypeOf(storeInstance);\n var instanceDescriptors = Object.getOwnPropertyDescriptors(storeInstance);\n var protoDescriptors = Object.getOwnPropertyDescriptors(proto);\n var descriptors = {\n ...protoDescriptors,\n ...instanceDescriptors\n };\n delete descriptors.constructor;\n return descriptors;\n}\nfunction get(_, b) {\n return _;\n}\nfunction simpleStr(arg) {\n if (process.env.NODE_ENV === \"development\") {\n return typeof arg === \"function\" ? \"fn\" : typeof arg === \"string\" ? `\"${arg}\"` : !arg ? arg : (typeof arg === \"undefined\" ? \"undefined\" : _type_of(arg)) !== \"object\" ? arg : Array.isArray(arg) ? \"[...]\" : `{...}`;\n }\n return arg;\n}\nfunction getStoreDebugInfo(store) {\n var _store_UNWRAP_STORE_INFO;\n return (_store_UNWRAP_STORE_INFO = store[UNWRAP_STORE_INFO]) !== null && _store_UNWRAP_STORE_INFO !== void 0 ? _store_UNWRAP_STORE_INFO : cache.get(getStoreUid(store.constructor, store.props));\n}\n//# sourceMappingURL=helpers.js.map\n"],"mappings":";;;AACA,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;CAC1C,IAAI,QAAQ,OAAO,eAAe,aAAa;CAC/C,IAAI,sBAAsB,OAAO,0BAA0B,aAAa;CACxE,IAAI,mBAAmB,OAAO,0BAA0B,KAAK;CAC7D,IAAI,cAAc;EAChB,GAAG;EACH,GAAG;CACL;CACA,OAAO,YAAY;CACnB,OAAO;AACT;AACA,SAAS,IAAI,GAAG,GAAG;CACjB,OAAO;AACT;AACA,SAAS,UAAU,KAAK;CACtB,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,OAAO,OAAO,QAAQ,aAAa,OAAO,OAAO,QAAQ,WAAW,IAAI,IAAI,KAAK,CAAC,MAAM,OAAO,OAAO,QAAQ,cAAc,cAAc,SAAS,GAAG,OAAO,WAAW,MAAM,MAAM,QAAQ,GAAG,IAAI,UAAU;CAC/M;CACA,OAAO;AACT;AACA,SAAS,kBAAkB,OAAO;CAChC,IAAI;CACJ,QAAQ,2BAA2B,MAAM,wBAAwB,QAAQ,6BAA6B,KAAK,IAAI,2BAA2B,MAAM,IAAI,YAAY,MAAM,aAAa,MAAM,KAAK,CAAC;AACjM"}
|
package/dist/cjs/index.cjs
CHANGED
package/dist/cjs/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n Store: () => Store,\n UNWRAP_PROXY: () => import_constants.UNWRAP_PROXY,\n configureUseStore: () => import_configureUseStore.configureUseStore\n});\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./useStore\"), module.exports);\nvar import_configureUseStore = require(\"./configureUseStore\");\n__reExport(index_exports, require(\"./interfaces\"), module.exports);\n__reExport(index_exports, require(\"./observe\"), module.exports);\nvar import_constants = require(\"./constants\");\n__reExport(index_exports, require(\"./comparators\"), module.exports);\n__reExport(index_exports, require(\"./decorators\"), module.exports);\nfunction _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nvar Store = function Store2(props) {\n \"use strict\";\n _class_call_check(this, Store2);\n _define_property(this, \"props\", void 0);\n this.props = props;\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n Store: () => Store,\n UNWRAP_PROXY: () => import_constants.UNWRAP_PROXY,\n configureUseStore: () => import_configureUseStore.configureUseStore\n});\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./useStore\"), module.exports);\nvar import_configureUseStore = require(\"./configureUseStore\");\n__reExport(index_exports, require(\"./interfaces\"), module.exports);\n__reExport(index_exports, require(\"./observe\"), module.exports);\nvar import_constants = require(\"./constants\");\n__reExport(index_exports, require(\"./comparators\"), module.exports);\n__reExport(index_exports, require(\"./decorators\"), module.exports);\nfunction _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nfunction _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nvar Store = function Store2(props) {\n \"use strict\";\n _class_call_check(this, Store2);\n _define_property(this, \"props\", void 0);\n this.props = props;\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,I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MAAM,SAAS,KAAK,CAAC;CACtC,KAAK,QAAQ;AACf"}
|
package/dist/cjs/interfaces.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.native.js","names":[],"sources":["cjs/interfaces.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar interfaces_exports = {};\nmodule.exports = __toCommonJS(interfaces_exports);\n//# sourceMappingURL=interfaces.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"interfaces.native.js","names":[],"sources":["cjs/interfaces.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar interfaces_exports = {};\nmodule.exports = __toCommonJS(interfaces_exports);\n//# sourceMappingURL=interfaces.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,qBAAqB,CAAC;AAC1B,OAAO,UAAU,aAAa,kBAAkB"}
|
package/dist/cjs/observe.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.native.js","names":[],"sources":["cjs/observe.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar observe_exports = {};\n__export(observe_exports, {\n observe: () => observe,\n useObserve: () => useObserve\n});\nmodule.exports = __toCommonJS(observe_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_comparators = require(\"./comparators\");\nvar import_constants = require(\"./constants\");\nvar import_useStore = require(\"./useStore\");\nvar logUpdate = process.env.NODE_ENV === \"development\" ? function(fn, stores, last, next) {\n var getStoreLogName = function(store) {\n var _store_props;\n var _store_UNWRAP_PROXY;\n var str = (_store_UNWRAP_PROXY = store[import_constants.UNWRAP_PROXY]) !== null && _store_UNWRAP_PROXY !== void 0 ? _store_UNWRAP_PROXY : store;\n return `${str.constructor.name}${((_store_props = store.props) === null || _store_props === void 0 ? void 0 : _store_props.id) ? `:${store.props.id}` : \"\"}`;\n };\n var storeNames = stores.map(getStoreLogName).join(\", \");\n var name = `\\u{1F311} \\u25B6\\uFE0F %c${fn.name} ${storeNames} () ${last} => ${next}`;\n console.groupCollapsed(name, \"color: tomato;\");\n console.groupCollapsed(\"trace >\");\n console.trace();\n console.groupEnd();\n console.info(\" next\", next);\n console.groupEnd();\n} : null;\nfunction observe(fn) {\n var prev = getObserverValueAndStoresAccessed(fn);\n var disposeValue = null;\n var subscribe = function() {\n var stores = [\n ...prev.storeInfos\n ];\n return subscribeToStores(stores, function() {\n disposeValue === null || disposeValue === void 0 ? void 0 : disposeValue();\n var next = getObserverValueAndStoresAccessed(fn);\n if (typeof next.value === \"function\") {\n disposeValue = next.value;\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [\n ...next.storeInfos\n ], \"(fn)\", \"(fn)\");\n }\n return;\n }\n if ((0, import_comparators.isEqualSubsetShallow)(prev.storeInfos, next.storeInfos) && (0, import_comparators.isEqualSubsetShallow)(prev.value, next.value)) {\n return;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [\n ...next.storeInfos\n ], prev.value, next.value);\n }\n prev = next;\n dispose();\n dispose = subscribe();\n });\n };\n var dispose = subscribe();\n return {\n dispose: function() {\n dispose();\n disposeValue === null || disposeValue === void 0 ? void 0 : disposeValue();\n },\n getValue: function() {\n return prev.value;\n }\n };\n}\nfunction useObserve(fn) {\n var [state, setState] = import_react.default.useState(function() {\n return getObserverValueAndStoresAccessed(fn);\n });\n import_react.default.useEffect(function() {\n var dispose;\n var unsub = subscribeToStores([\n ...state.storeInfos\n ], function() {\n dispose === null || dispose === void 0 ? void 0 : dispose();\n var next = getObserverValueAndStoresAccessed(fn);\n var nextStoreInfos = [\n ...next.storeInfos\n ];\n var prevStoreInfos = [\n ...state.storeInfos\n ];\n if (typeof next.value === \"function\") {\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, \"(fn)\", \"(fn)\");\n }\n dispose = next.value;\n return;\n }\n setState(function(prev) {\n if ((0, import_comparators.isEqualSubsetShallow)(prevStoreInfos, nextStoreInfos) && (0, import_comparators.isEqualSubsetShallow)(prev.value, next.value)) {\n return prev;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, prev.value, next.value);\n }\n return next;\n });\n });\n return function() {\n unsub();\n dispose === null || dispose === void 0 ? void 0 : dispose();\n };\n }, [\n [\n ...state.storeInfos\n ].map(function(i) {\n return i.uid;\n }).join(\",\")\n ]);\n return state.value;\n}\nfunction getObserverValueAndStoresAccessed(selector) {\n var storeInfos = /* @__PURE__ */ new Set();\n var dispose = (0, import_useStore.trackStoresAccess)(function(storeInfo) {\n storeInfos.add(storeInfo);\n });\n var value = selector();\n dispose();\n return {\n value,\n storeInfos\n };\n}\nfunction subscribeToStores(storeInfos, onUpdate) {\n var disposes = [];\n var isUpdating = false;\n var onUpdateDebouncedWithoutTracking = function() {\n if (isUpdating) return;\n isUpdating = true;\n queueMicrotask(function() {\n try {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = storeInfos[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var storeInfo2 = _step2.value;\n storeInfo2.disableTracking = true;\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n onUpdate();\n } finally {\n isUpdating = false;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = storeInfos[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var storeInfo1 = _step1.value;\n storeInfo1.disableTracking = false;\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n });\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = storeInfos[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var storeInfo = _step.value;\n disposes.push(storeInfo.subscribe(onUpdateDebouncedWithoutTracking));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return function() {\n disposes.forEach(function(x) {\n return x();\n });\n };\n}\n//# sourceMappingURL=observe.js.map\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kB;IACpB,UAAU;KACR,IAAI;MACF,IAAI,CAAC,8BAA8B,WAAW,UAAU,MAAM;OAC5D,WAAW,OAAO;MACpB;KACF,UAAU;MACR,IAAI,oBAAoB;OACtB,MAAM;MACR;KACF;IACF;GACF;EACF,CAAC;CACH;CACA,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,WAAW,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;GAC3J,IAAI,YAAY,MAAM;GACtB,SAAS,KAAK,UAAU,UAAU,gCAAgC,CAAC;EACrE;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO,WAAW;EAChB,SAAS,QAAQ,SAAS,GAAG;GAC3B,OAAO,EAAE;EACX,CAAC;CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"observe.native.js","names":[],"sources":["cjs/observe.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar observe_exports = {};\n__export(observe_exports, {\n observe: () => observe,\n useObserve: () => useObserve\n});\nmodule.exports = __toCommonJS(observe_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_comparators = require(\"./comparators\");\nvar import_constants = require(\"./constants\");\nvar import_useStore = require(\"./useStore\");\nvar logUpdate = process.env.NODE_ENV === \"development\" ? function(fn, stores, last, next) {\n var getStoreLogName = function(store) {\n var _store_props;\n var _store_UNWRAP_PROXY;\n var str = (_store_UNWRAP_PROXY = store[import_constants.UNWRAP_PROXY]) !== null && _store_UNWRAP_PROXY !== void 0 ? _store_UNWRAP_PROXY : store;\n return `${str.constructor.name}${((_store_props = store.props) === null || _store_props === void 0 ? void 0 : _store_props.id) ? `:${store.props.id}` : \"\"}`;\n };\n var storeNames = stores.map(getStoreLogName).join(\", \");\n var name = `\\u{1F311} \\u25B6\\uFE0F %c${fn.name} ${storeNames} () ${last} => ${next}`;\n console.groupCollapsed(name, \"color: tomato;\");\n console.groupCollapsed(\"trace >\");\n console.trace();\n console.groupEnd();\n console.info(\" next\", next);\n console.groupEnd();\n} : null;\nfunction observe(fn) {\n var prev = getObserverValueAndStoresAccessed(fn);\n var disposeValue = null;\n var subscribe = function() {\n var stores = [\n ...prev.storeInfos\n ];\n return subscribeToStores(stores, function() {\n disposeValue === null || disposeValue === void 0 ? void 0 : disposeValue();\n var next = getObserverValueAndStoresAccessed(fn);\n if (typeof next.value === \"function\") {\n disposeValue = next.value;\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [\n ...next.storeInfos\n ], \"(fn)\", \"(fn)\");\n }\n return;\n }\n if ((0, import_comparators.isEqualSubsetShallow)(prev.storeInfos, next.storeInfos) && (0, import_comparators.isEqualSubsetShallow)(prev.value, next.value)) {\n return;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [\n ...next.storeInfos\n ], prev.value, next.value);\n }\n prev = next;\n dispose();\n dispose = subscribe();\n });\n };\n var dispose = subscribe();\n return {\n dispose: function() {\n dispose();\n disposeValue === null || disposeValue === void 0 ? void 0 : disposeValue();\n },\n getValue: function() {\n return prev.value;\n }\n };\n}\nfunction useObserve(fn) {\n var [state, setState] = import_react.default.useState(function() {\n return getObserverValueAndStoresAccessed(fn);\n });\n import_react.default.useEffect(function() {\n var dispose;\n var unsub = subscribeToStores([\n ...state.storeInfos\n ], function() {\n dispose === null || dispose === void 0 ? void 0 : dispose();\n var next = getObserverValueAndStoresAccessed(fn);\n var nextStoreInfos = [\n ...next.storeInfos\n ];\n var prevStoreInfos = [\n ...state.storeInfos\n ];\n if (typeof next.value === \"function\") {\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, \"(fn)\", \"(fn)\");\n }\n dispose = next.value;\n return;\n }\n setState(function(prev) {\n if ((0, import_comparators.isEqualSubsetShallow)(prevStoreInfos, nextStoreInfos) && (0, import_comparators.isEqualSubsetShallow)(prev.value, next.value)) {\n return prev;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, prev.value, next.value);\n }\n return next;\n });\n });\n return function() {\n unsub();\n dispose === null || dispose === void 0 ? void 0 : dispose();\n };\n }, [\n [\n ...state.storeInfos\n ].map(function(i) {\n return i.uid;\n }).join(\",\")\n ]);\n return state.value;\n}\nfunction getObserverValueAndStoresAccessed(selector) {\n var storeInfos = /* @__PURE__ */ new Set();\n var dispose = (0, import_useStore.trackStoresAccess)(function(storeInfo) {\n storeInfos.add(storeInfo);\n });\n var value = selector();\n dispose();\n return {\n value,\n storeInfos\n };\n}\nfunction subscribeToStores(storeInfos, onUpdate) {\n var disposes = [];\n var isUpdating = false;\n var onUpdateDebouncedWithoutTracking = function() {\n if (isUpdating) return;\n isUpdating = true;\n queueMicrotask(function() {\n try {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = storeInfos[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var storeInfo2 = _step2.value;\n storeInfo2.disableTracking = true;\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n onUpdate();\n } finally {\n isUpdating = false;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = storeInfos[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var storeInfo1 = _step1.value;\n storeInfo1.disableTracking = false;\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n });\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = storeInfos[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var storeInfo = _step.value;\n disposes.push(storeInfo.subscribe(onUpdateDebouncedWithoutTracking));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return function() {\n disposes.forEach(function(x) {\n return x();\n });\n };\n}\n//# sourceMappingURL=observe.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,kBAAkB,CAAC;AACvB,SAAS,iBAAiB;CACxB,eAAe;CACf,kBAAkB;AACpB,CAAC;AACD,OAAO,UAAU,aAAa,eAAe;AAC7C,IAAI,eAAe,QAAQ,QAAQ,OAAO,GAAG,CAAC;AAC9C,IAAI,qBAAqB,QAAQ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AS,CAAC,GAAG,QAAQ,EAAE,8BAA8B,SAAS,WAAW,KAAK,EAAC,CAAE,OAAO,6BAA6B,MAAM;MACjK,IAAI,aAAa,OAAO;MACxB,WAAW,kBAAkB;KAC/B;IACF,SAAS,KAAK;KACZ,qBAAqB;KACrB,kBAAkB;IACpB,UAAU;KACR,IAAI;MACF,IAAI,CAAC,8BAA8B,WAAW,UAAU,MAAM;OAC5D,WAAW,OAAO;MACpB;KACF,UAAU;MACR,IAAI,oBAAoB;OACtB,MAAM;MACR;KACF;IACF;GACF;EACF,CAAC;CACH;CACA,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,WAAW,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;GAC3J,IAAI,YAAY,MAAM;GACtB,SAAS,KAAK,UAAU,UAAU,gCAAgC,CAAC;EACrE;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO,WAAW;EAChB,SAAS,QAAQ,SAAS,GAAG;GAC3B,OAAO,EAAE;EACX,CAAC;CACH;AACF"}
|
package/dist/cjs/useStore.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStore.native.js","names":[],"sources":["cjs/useStore.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useStore_exports = {};\n__export(useStore_exports, {\n\tallStores: () => allStores,\n\tcreateStore: () => createStore,\n\tcreateUseStore: () => createUseStore,\n\tcreateUseStoreSelector: () => createUseStoreSelector,\n\tgetOrCreateStore: () => getOrCreateStore,\n\tgetStore: () => getStore,\n\tgetStoreInfo: () => getStoreInfo,\n\tonCreateStore: () => onCreateStore,\n\tsetIsInReaction: () => setIsInReaction,\n\ttrackStoresAccess: () => trackStoresAccess,\n\tuseGlobalStore: () => useGlobalStore,\n\tuseGlobalStoreSelector: () => useGlobalStoreSelector,\n\tuseStore: () => useStore,\n\tuseStoreDebug: () => useStoreDebug,\n\tuseStoreSelector: () => useStoreSelector\n});\nmodule.exports = __toCommonJS(useStore_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_comparators = require(\"./comparators\");\nvar import_configureUseStore = require(\"./configureUseStore\");\nvar import_constants = require(\"./constants\");\nvar import_helpers = require(\"./helpers\");\nvar import_useStoreDebug = require(\"./useStoreDebug\");\nfunction _instanceof(left, right) {\n\tif (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);\n\telse return left instanceof right;\n}\nvar idFn = function(_) {\n\treturn _;\n};\nfunction useStore(StoreKlass, props) {\n\tvar options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants.defaultOptions;\n\treturn useStoreFromInfo(getOrCreateStoreInfo(StoreKlass, props, options), options.selector, options);\n}\nfunction useStoreDebug(StoreKlass, props) {\n\treturn useStore(StoreKlass, props, { debug: true });\n}\nfunction createStore(StoreKlass, props, options) {\n\tvar _getOrCreateStoreInfo;\n\treturn (_getOrCreateStoreInfo = getOrCreateStoreInfo(StoreKlass, props, options)) === null || _getOrCreateStoreInfo === void 0 ? void 0 : _getOrCreateStoreInfo.store;\n}\nfunction useGlobalStore(instance, debug) {\n\tvar store = instance[import_constants.UNWRAP_PROXY];\n\tvar uid = (0, import_helpers.getStoreUid)(store.constructor, store.props);\n\tvar info = import_helpers.cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, void 0, { debug });\n}\nfunction useGlobalStoreSelector(instance, selector, debug) {\n\tvar store = instance[import_constants.UNWRAP_PROXY];\n\tvar uid = (0, import_helpers.getStoreUid)(store.constructor, store.props);\n\tvar info = import_helpers.cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, selector, { debug });\n}\nfunction createUseStore(StoreKlass) {\n\treturn function(props, options) {\n\t\treturn useStore(StoreKlass, props, options);\n\t};\n}\nfunction createUseStoreSelector(StoreKlass, selector) {\n\treturn function(props) {\n\t\treturn useStore(StoreKlass, props, { selector });\n\t};\n}\nfunction useStoreSelector(StoreKlass, selector, props) {\n\treturn useStore(StoreKlass, props, { selector });\n}\nvar storeAccessTrackers = /* @__PURE__ */ new Set();\nfunction trackStoresAccess(cb) {\n\tstoreAccessTrackers.add(cb);\n\treturn function() {\n\t\tstoreAccessTrackers.delete(cb);\n\t};\n}\nfunction getStore(StoreKlass, props) {\n\tvar _getStoreInfo;\n\treturn (_getStoreInfo = getStoreInfo(StoreKlass, props)) === null || _getStoreInfo === void 0 ? void 0 : _getStoreInfo.store;\n}\nfunction getOrCreateStore(StoreKlass, props) {\n\tvar _getOrCreateStoreInfo;\n\treturn (_getOrCreateStoreInfo = getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: false })) === null || _getOrCreateStoreInfo === void 0 ? void 0 : _getOrCreateStoreInfo.store;\n}\nfunction getStoreInfo(StoreKlass, props) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: true });\n}\nvar onCreateListeners = /* @__PURE__ */ new Set();\nfunction onCreateStore(cb) {\n\tonCreateListeners.add(cb);\n\treturn function() {\n\t\tonCreateListeners.delete(cb);\n\t};\n}\nfunction getOrCreateStoreInfo(StoreKlass, props, options, propsKeyCalculated) {\n\tvar _store_mount;\n\tif (!StoreKlass) return null;\n\tvar uid = (0, import_helpers.getStoreUid)(StoreKlass, propsKeyCalculated !== null && propsKeyCalculated !== void 0 ? propsKeyCalculated : props);\n\tif (!(options === null || options === void 0 ? void 0 : options.avoidCache) && import_helpers.cache.has(uid)) return import_helpers.cache.get(uid);\n\tif (options === null || options === void 0 ? void 0 : options.refuseCreation) throw new Error(`No store exists (${StoreKlass.name}) with props: ${props}`);\n\tvar storeInstance = new StoreKlass(props);\n\tstoreInstance.props = props;\n\tvar getters = {};\n\tvar actions = {};\n\tvar stateKeys = /* @__PURE__ */ new Set();\n\tvar descriptors = (0, import_helpers.getStoreDescriptors)(storeInstance);\n\tfor (var key in descriptors) {\n\t\tvar descriptor = descriptors[key];\n\t\tif (typeof descriptor.value === \"function\") actions[key] = descriptor.value;\n\t\telse if (typeof descriptor.get === \"function\") getters[key] = descriptor.get;\n\t\telse if (key !== \"props\" && key[0] !== \"_\") stateKeys.add(key);\n\t}\n\tvar keyComparators = storeInstance[\"_comparators\"];\n\tvar listeners = /* @__PURE__ */ new Set();\n\tvar storeInfo = {\n\t\tuid,\n\t\tkeyComparators,\n\t\tstoreInstance,\n\t\tgetters,\n\t\tstateKeys,\n\t\tprops,\n\t\tactions,\n\t\tdebug: options === null || options === void 0 ? void 0 : options.debug,\n\t\tdisableTracking: false,\n\t\tgettersState: {\n\t\t\tgetCache: /* @__PURE__ */ new Map(),\n\t\t\tdepsToGetter: /* @__PURE__ */ new Map(),\n\t\t\tcurGetKeys: /* @__PURE__ */ new Set(),\n\t\t\tisGetting: false\n\t\t},\n\t\tlisteners,\n\t\ttrackers: /* @__PURE__ */ new Set(),\n\t\tversion: 0,\n\t\tsubscribe: function(onChanged) {\n\t\t\tlisteners.add(onChanged);\n\t\t\treturn function() {\n\t\t\t\tlisteners.delete(onChanged);\n\t\t\t};\n\t\t},\n\t\ttriggerUpdate: function() {\n\t\t\tstoreInfo.version = (storeInfo.version + 1) % Number.MAX_SAFE_INTEGER;\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar cb = _step.value;\n\t\t\t\t\tcb();\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\tvar store = createProxiedStore(\n\t\t// we assign store right after and proxiedStore never accesses it until later on\n\t\tstoreInfo\n\t);\n\tif (process.env.NODE_ENV === \"development\") allStores[StoreKlass.name + uid] = store;\n\t(_store_mount = store.mount) === null || _store_mount === void 0 || _store_mount.call(store);\n\tstoreInfo.store = store;\n\tvar result = storeInfo;\n\timport_helpers.cache.set(uid, result);\n\tonCreateListeners.forEach(function(cb) {\n\t\treturn cb(result);\n\t});\n\treturn result;\n}\nvar allStores = {};\nif (process.env.NODE_ENV === \"development\") {\n\tvar _globalThis, _Store;\n\t(_globalThis = globalThis)[_Store = \"Store\"] || (_globalThis[_Store] = allStores);\n}\nvar emptyObj = {};\nvar selectKeys = function(obj, keys) {\n\tif (!keys.length) return emptyObj;\n\tvar res = {};\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar key = _step.value;\n\t\t\tres[key] = obj[key];\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn res;\n};\nvar isInReaction = false;\nvar setIsInReaction = function(val) {\n\tisInReaction = val;\n};\nfunction useStoreFromInfo(info, userSelector, options) {\n\tvar store = info === null || info === void 0 ? void 0 : info.store;\n\tvar internal = import_react.default.useRef(void 0);\n\tvar component = (0, import_useStoreDebug.useCurrentComponent)();\n\tif (!internal.current) internal.current = {\n\t\tcomponent,\n\t\ttracked: /* @__PURE__ */ new Set(),\n\t\tlast: null,\n\t\tlastKeys: null\n\t};\n\tvar curInternal = internal.current;\n\tvar shouldPrintDebug = options === null || options === void 0 ? void 0 : options.debug;\n\tvar getSnapshot = import_react.default.useCallback(function() {\n\t\tif (!info || !store) return;\n\t\tvar curInternal2 = internal.current;\n\t\tvar isTracking = curInternal2.tracked.size;\n\t\tvar keys = [...!isTracking ? info.stateKeys : curInternal2.tracked];\n\t\tvar nextKeys = `${info.version}${keys.join(\"\")}${userSelector || \"\"}`;\n\t\tvar lastKeys = curInternal2.lastKeys;\n\t\tif (nextKeys === curInternal2.lastKeys) return curInternal2.last;\n\t\tcurInternal2.lastKeys = nextKeys;\n\t\tvar snap;\n\t\tinfo.disableTracking = true;\n\t\tvar last = curInternal2.last;\n\t\tif (userSelector) snap = userSelector(store);\n\t\telse snap = selectKeys(store, keys);\n\t\tinfo.disableTracking = false;\n\t\tvar isUnchanged = !userSelector && !isTracking && last || typeof last !== \"undefined\" && (0, import_comparators.isEqualSubsetShallow)(last, snap, { keyComparators: info.keyComparators });\n\t\tif (shouldPrintDebug) console.info(\"🌑 getSnapshot\", {\n\t\t\tstoreState: selectKeys(store, Object.keys(store)),\n\t\t\tuserSelector,\n\t\t\tinfo,\n\t\t\tisUnchanged,\n\t\t\tcomponent,\n\t\t\tkeys,\n\t\t\tlast,\n\t\t\tsnap,\n\t\t\tcurInternal: curInternal2,\n\t\t\tnextKeys,\n\t\t\tlastKeys\n\t\t});\n\t\tif (isUnchanged) return last;\n\t\tcurInternal2.last = snap;\n\t\treturn snap;\n\t}, [store]);\n\tvar state = import_react.default.useSyncExternalStore((info === null || info === void 0 ? void 0 : info.subscribe) || idFn, getSnapshot, getSnapshot);\n\tif (!info || !store || !state) return state;\n\tif (userSelector) return state;\n\treturn new Proxy(store, { get(target, key) {\n\t\tvar curVal = Reflect.get(target, key);\n\t\tif (isInReaction) return curVal;\n\t\tvar keyString = key;\n\t\tif (info.stateKeys.has(keyString) || keyString in info.getters) {\n\t\t\tif (shouldPrintDebug) console.info(\"👀 tracking\", keyString);\n\t\t\tcurInternal.tracked.add(keyString);\n\t\t}\n\t\tif (Reflect.has(state, key)) return Reflect.get(state, key);\n\t\treturn curVal;\n\t} });\n}\nvar setters = /* @__PURE__ */ new Set();\nvar logStack = /* @__PURE__ */ new Set();\nfunction createProxiedStore(storeInfo) {\n\tvar _loop = function(key2) {\n\t\tif (key2 === \"subscribe\") return \"continue\";\n\t\tvar actionFn = actions[key2];\n\t\tvar isGetFn = key2.startsWith(\"get\");\n\t\twrappedActions[key2] = function useStoreAction() {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\t\t\tvar res;\n\t\t\tif (isGetFn || gettersState.isGetting) return Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) startAction\", key2);\n\t\t\tres = Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (_instanceof(res, Promise)) return res.then(finishAction);\n\t\t\tfinishAction();\n\t\t\treturn res;\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\tlet hashCode2 = function(str) {\n\t\t\t\tvar hash = 0;\n\t\t\t\tfor (var i = 0; i < str.length; i++) hash = str.charCodeAt(i) + ((hash << 5) - hash);\n\t\t\t\treturn hash;\n\t\t\t}, strColor2 = function(str) {\n\t\t\t\treturn `hsl(${hashCode2(str) % 360}, 90%, 40%)`;\n\t\t\t};\n\t\t\tif (!key2.startsWith(\"get\") && !key2.startsWith(\"_\") && key2 !== \"subscribe\") {\n\t\t\t\tvar ogAction = wrappedActions[key2];\n\t\t\t\twrappedActions[key2] = new Proxy(ogAction, { apply(target, thisArg, args) {\n\t\t\t\t\tvar isDebugging = shouldDebug2 || storeInfo.debug;\n\t\t\t\t\tif (!(process.env.LOG_LEVEL !== \"0\" && (isDebugging || import_configureUseStore.configureOpts.logLevel !== \"error\"))) return Reflect.apply(target, thisArg, args);\n\t\t\t\t\tsetters = /* @__PURE__ */ new Set();\n\t\t\t\t\tvar curSetters = setters;\n\t\t\t\t\tvar isTopLevelLogger = logStack.size == 0;\n\t\t\t\t\tvar logs = /* @__PURE__ */ new Set();\n\t\t\t\t\tlogStack.add(logs);\n\t\t\t\t\tvar res;\n\t\t\t\t\tvar id = counter++;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tres = Reflect.apply(target, thisArg, args);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(\"Error\", err);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tlogStack.add(\"end\");\n\t\t\t\t\t\tvar name = constr.name;\n\t\t\t\t\t\tvar color = strColor2(name);\n\t\t\t\t\t\tvar simpleArgs = args.map(import_helpers.simpleStr);\n\t\t\t\t\t\tlogs.add([\n\t\t\t\t\t\t\t`%c \\u{1F311} ${id} ${name.padStart(isTopLevelLogger ? 8 : 4)}%c.${key2}(${simpleArgs.join(\", \")})${isTopLevelLogger && logStack.size > 1 ? ` (+${logStack.size - 1})` : \"\"}`,\n\t\t\t\t\t\t\t`color: ${color};`,\n\t\t\t\t\t\t\t\"color: black;\"\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tif (curSetters.size) curSetters.forEach(function(param) {\n\t\t\t\t\t\t\tvar { key: key3, value } = param;\n\t\t\t\t\t\t\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") logs.add([` SET ${key3} ${value}`, value]);\n\t\t\t\t\t\t\telse logs.add([` SET ${key3}`, value]);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (isTopLevelLogger) {\n\t\t\t\t\t\t\tvar error = null;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tfor (var _iterator = logStack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\t\t\t\t\t\tvar item = _step.value;\n\t\t\t\t\t\t\t\t\t\tif (item === \"end\") {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvar [head, ...rest] = item;\n\t\t\t\t\t\t\t\t\t\tif (head) {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(...head);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"...\");\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(\"args\", args);\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(\"response\", res);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"trace\");\n\t\t\t\t\t\t\t\t\t\t\tconsole.trace();\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var _iterator1 = rest[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar [name1, ...log] = _step1.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(name1);\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.info(...log);\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t\t\t\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else console.info(\"Weird log\", head, ...rest);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t\t\t\t\t_iteratorError = err;\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\terror = err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfor (var _iterator2 = logStack[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\t\t\t\t\t\t_step2.value;\n\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t_didIteratorError2 = true;\n\t\t\t\t\t\t\t\t_iteratorError2 = err;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (error) console.error(`error loggin`, error);\n\t\t\t\t\t\t\tlogStack.clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t};\n\tvar { actions, storeInstance, getters, gettersState } = storeInfo;\n\tvar { getCache, curGetKeys, depsToGetter } = gettersState;\n\tvar constr = storeInstance.constructor;\n\tvar _storeInfo_debug;\n\tvar shouldDebug2 = (_storeInfo_debug = storeInfo.debug) !== null && _storeInfo_debug !== void 0 ? _storeInfo_debug : import_useStoreDebug.DebugStores.has(constr);\n\tvar didSet = false;\n\tvar wrappedActions = {};\n\tfor (var key in actions) _loop(key);\n\tvar finishAction = function(val) {\n\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) finishAction\", { didSet });\n\t\tif (didSet) {\n\t\t\tstoreInfo.triggerUpdate();\n\t\t\tdidSet = false;\n\t\t}\n\t\treturn val;\n\t};\n\tvar isTriggering = false;\n\tvar proxiedStore = new Proxy(storeInstance, {\n\t\tget(_, key2) {\n\t\t\tif (key2 in wrappedActions) return wrappedActions[key2];\n\t\t\tif (key2 in passThroughKeys) return Reflect.get(storeInstance, key2);\n\t\t\tif (key2 === import_constants.UNWRAP_PROXY) return storeInstance;\n\t\t\tif (key2 === import_helpers.UNWRAP_STORE_INFO) return storeInfo;\n\t\t\tif (storeAccessTrackers.size) storeAccessTrackers.forEach(function(cb) {\n\t\t\t\treturn cb(storeInfo);\n\t\t\t});\n\t\t\tif (typeof key2 !== \"string\") return Reflect.get(storeInstance, key2);\n\t\t\tif (!storeInfo.disableTracking) {\n\t\t\t\tif (gettersState.isGetting) gettersState.curGetKeys.add(key2);\n\t\t\t}\n\t\t\tif (key2 in getters) {\n\t\t\t\tif (getCache.has(key2)) return getCache.get(key2);\n\t\t\t\tcurGetKeys.clear();\n\t\t\t\tvar isSubGetter = gettersState.isGetting;\n\t\t\t\tgettersState.isGetting = true;\n\t\t\t\tvar res = getters[key2].call(proxiedStore);\n\t\t\t\tif (!isSubGetter) gettersState.isGetting = false;\n\t\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator = curGetKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\t\tvar gk = _step.value;\n\t\t\t\t\t\tif (!depsToGetter.has(gk)) depsToGetter.set(gk, /* @__PURE__ */ new Set());\n\t\t\t\t\t\tdepsToGetter.get(gk).add(key2);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t_iteratorError = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgetCache.set(key2, res);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\treturn Reflect.get(storeInstance, key2);\n\t\t},\n\t\tset(target, key2, value, receiver) {\n\t\t\tvar cur = Reflect.get(target, key2);\n\t\t\tvar res = Reflect.set(target, key2, value, receiver);\n\t\t\tif (res && cur !== value) {\n\t\t\t\tif (typeof key2 === \"string\") {\n\t\t\t\t\tclearGetterCache(key2);\n\t\t\t\t\tif (shouldDebug2) {\n\t\t\t\t\t\tsetters.add({\n\t\t\t\t\t\t\tkey: key2,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (getShouldDebug(storeInfo)) console.info(\"(debug) SET\", res, key2, value);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"SET...\", {\n\t\t\t\t\t\tkey: key2,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (!isTriggering) {\n\t\t\t\t\tisTriggering = true;\n\t\t\t\t\twaitForEventLoop(function() {\n\t\t\t\t\t\tstoreInfo.triggerUpdate();\n\t\t\t\t\t\tisTriggering = false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t});\n\tfunction clearGetterCache(setKey) {\n\t\tvar parentGetters = depsToGetter.get(setKey);\n\t\tgetCache.delete(setKey);\n\t\tif (!parentGetters) return;\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = parentGetters[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar gk = _step.value;\n\t\t\t\tgetCache.delete(gk);\n\t\t\t\tif (depsToGetter.has(gk)) clearGetterCache(gk);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\treturn proxiedStore;\n}\nvar waitForEventLoop = (process.env.NODE_ENV, function(cb) {\n\treturn cb();\n});\nvar counter = 0;\nvar passThroughKeys = {\n\tsubscribe: true,\n\t_version: true,\n\t_trackers: true,\n\t$$typeof: true,\n\t_listeners: true,\n\t_enableTracking: true\n};\nfunction getShouldDebug(storeInfo) {\n\tvar info = { storeInstance: storeInfo.store };\n\treturn [...storeInfo.trackers].some(function(tracker) {\n\t\treturn tracker.component && (0, import_useStoreDebug.shouldDebug)(tracker.component, info);\n\t});\n}\n//# sourceMappingURL=useStore.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B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KAAK,IAAI,YAAY,cAAc,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;IAC/J,IAAI,KAAK,MAAM;IACf,SAAS,OAAO,EAAE;IAClB,IAAI,aAAa,IAAI,EAAE,GAAG,iBAAiB,EAAE;GAC9C;EACD,SAAS,KAAK;GACb,oBAAoB;GACpB,iBAAiB;EAClB,UAAU;GACT,IAAI;IACH,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM,UAAU,OAAO;GAC9E,UAAU;IACT,IAAI,mBAAmB,MAAM;GAC9B;EACD;CACD;CACA,OAAO;AACR;AACA,IAAI,oBAAoB,QAAQ,IAAI,UAAU,SAAS,IAAI;CAC1D,OAAO,GAAG;AACX;AACA,IAAI,UAAU;AACd,IAAI,kBAAkB;CACrB,WAAW;CACX,UAAU;CACV,WAAW;CACX,UAAU;CACV,YAAY;CACZ,iBAAiB;AAClB;AACA,SAAS,eAAe,WAAW;CAClC,IAAI,OAAO,EAAE,eAAe,UAAU,MAAM;CAC5C,OAAO,CAAC,GAAG,UAAU,QAAQ,EAAE,KAAK,SAAS,SAAS;EACrD,OAAO,QAAQ,cAAc,GAAG,qBAAqB,aAAa,QAAQ,WAAW,IAAI;CAC1F,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"useStore.native.js","names":[],"sources":["cjs/useStore.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useStore_exports = {};\n__export(useStore_exports, {\n\tallStores: () => allStores,\n\tcreateStore: () => createStore,\n\tcreateUseStore: () => createUseStore,\n\tcreateUseStoreSelector: () => createUseStoreSelector,\n\tgetOrCreateStore: () => getOrCreateStore,\n\tgetStore: () => getStore,\n\tgetStoreInfo: () => getStoreInfo,\n\tonCreateStore: () => onCreateStore,\n\tsetIsInReaction: () => setIsInReaction,\n\ttrackStoresAccess: () => trackStoresAccess,\n\tuseGlobalStore: () => useGlobalStore,\n\tuseGlobalStoreSelector: () => useGlobalStoreSelector,\n\tuseStore: () => useStore,\n\tuseStoreDebug: () => useStoreDebug,\n\tuseStoreSelector: () => useStoreSelector\n});\nmodule.exports = __toCommonJS(useStore_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_comparators = require(\"./comparators\");\nvar import_configureUseStore = require(\"./configureUseStore\");\nvar import_constants = require(\"./constants\");\nvar import_helpers = require(\"./helpers\");\nvar import_useStoreDebug = require(\"./useStoreDebug\");\nfunction _instanceof(left, right) {\n\tif (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);\n\telse return left instanceof right;\n}\nvar idFn = function(_) {\n\treturn _;\n};\nfunction useStore(StoreKlass, props) {\n\tvar options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants.defaultOptions;\n\treturn useStoreFromInfo(getOrCreateStoreInfo(StoreKlass, props, options), options.selector, options);\n}\nfunction useStoreDebug(StoreKlass, props) {\n\treturn useStore(StoreKlass, props, { debug: true });\n}\nfunction createStore(StoreKlass, props, options) {\n\tvar _getOrCreateStoreInfo;\n\treturn (_getOrCreateStoreInfo = getOrCreateStoreInfo(StoreKlass, props, options)) === null || _getOrCreateStoreInfo === void 0 ? void 0 : _getOrCreateStoreInfo.store;\n}\nfunction useGlobalStore(instance, debug) {\n\tvar store = instance[import_constants.UNWRAP_PROXY];\n\tvar uid = (0, import_helpers.getStoreUid)(store.constructor, store.props);\n\tvar info = import_helpers.cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, void 0, { debug });\n}\nfunction useGlobalStoreSelector(instance, selector, debug) {\n\tvar store = instance[import_constants.UNWRAP_PROXY];\n\tvar uid = (0, import_helpers.getStoreUid)(store.constructor, store.props);\n\tvar info = import_helpers.cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, selector, { debug });\n}\nfunction createUseStore(StoreKlass) {\n\treturn function(props, options) {\n\t\treturn useStore(StoreKlass, props, options);\n\t};\n}\nfunction createUseStoreSelector(StoreKlass, selector) {\n\treturn function(props) {\n\t\treturn useStore(StoreKlass, props, { selector });\n\t};\n}\nfunction useStoreSelector(StoreKlass, selector, props) {\n\treturn useStore(StoreKlass, props, { selector });\n}\nvar storeAccessTrackers = /* @__PURE__ */ new Set();\nfunction trackStoresAccess(cb) {\n\tstoreAccessTrackers.add(cb);\n\treturn function() {\n\t\tstoreAccessTrackers.delete(cb);\n\t};\n}\nfunction getStore(StoreKlass, props) {\n\tvar _getStoreInfo;\n\treturn (_getStoreInfo = getStoreInfo(StoreKlass, props)) === null || _getStoreInfo === void 0 ? void 0 : _getStoreInfo.store;\n}\nfunction getOrCreateStore(StoreKlass, props) {\n\tvar _getOrCreateStoreInfo;\n\treturn (_getOrCreateStoreInfo = getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: false })) === null || _getOrCreateStoreInfo === void 0 ? void 0 : _getOrCreateStoreInfo.store;\n}\nfunction getStoreInfo(StoreKlass, props) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: true });\n}\nvar onCreateListeners = /* @__PURE__ */ new Set();\nfunction onCreateStore(cb) {\n\tonCreateListeners.add(cb);\n\treturn function() {\n\t\tonCreateListeners.delete(cb);\n\t};\n}\nfunction getOrCreateStoreInfo(StoreKlass, props, options, propsKeyCalculated) {\n\tvar _store_mount;\n\tif (!StoreKlass) return null;\n\tvar uid = (0, import_helpers.getStoreUid)(StoreKlass, propsKeyCalculated !== null && propsKeyCalculated !== void 0 ? propsKeyCalculated : props);\n\tif (!(options === null || options === void 0 ? void 0 : options.avoidCache) && import_helpers.cache.has(uid)) return import_helpers.cache.get(uid);\n\tif (options === null || options === void 0 ? void 0 : options.refuseCreation) throw new Error(`No store exists (${StoreKlass.name}) with props: ${props}`);\n\tvar storeInstance = new StoreKlass(props);\n\tstoreInstance.props = props;\n\tvar getters = {};\n\tvar actions = {};\n\tvar stateKeys = /* @__PURE__ */ new Set();\n\tvar descriptors = (0, import_helpers.getStoreDescriptors)(storeInstance);\n\tfor (var key in descriptors) {\n\t\tvar descriptor = descriptors[key];\n\t\tif (typeof descriptor.value === \"function\") actions[key] = descriptor.value;\n\t\telse if (typeof descriptor.get === \"function\") getters[key] = descriptor.get;\n\t\telse if (key !== \"props\" && key[0] !== \"_\") stateKeys.add(key);\n\t}\n\tvar keyComparators = storeInstance[\"_comparators\"];\n\tvar listeners = /* @__PURE__ */ new Set();\n\tvar storeInfo = {\n\t\tuid,\n\t\tkeyComparators,\n\t\tstoreInstance,\n\t\tgetters,\n\t\tstateKeys,\n\t\tprops,\n\t\tactions,\n\t\tdebug: options === null || options === void 0 ? void 0 : options.debug,\n\t\tdisableTracking: false,\n\t\tgettersState: {\n\t\t\tgetCache: /* @__PURE__ */ new Map(),\n\t\t\tdepsToGetter: /* @__PURE__ */ new Map(),\n\t\t\tcurGetKeys: /* @__PURE__ */ new Set(),\n\t\t\tisGetting: false\n\t\t},\n\t\tlisteners,\n\t\ttrackers: /* @__PURE__ */ new Set(),\n\t\tversion: 0,\n\t\tsubscribe: function(onChanged) {\n\t\t\tlisteners.add(onChanged);\n\t\t\treturn function() {\n\t\t\t\tlisteners.delete(onChanged);\n\t\t\t};\n\t\t},\n\t\ttriggerUpdate: function() {\n\t\t\tstoreInfo.version = (storeInfo.version + 1) % Number.MAX_SAFE_INTEGER;\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar cb = _step.value;\n\t\t\t\t\tcb();\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\tvar store = createProxiedStore(\n\t\t// we assign store right after and proxiedStore never accesses it until later on\n\t\tstoreInfo\n\t);\n\tif (process.env.NODE_ENV === \"development\") allStores[StoreKlass.name + uid] = store;\n\t(_store_mount = store.mount) === null || _store_mount === void 0 || _store_mount.call(store);\n\tstoreInfo.store = store;\n\tvar result = storeInfo;\n\timport_helpers.cache.set(uid, result);\n\tonCreateListeners.forEach(function(cb) {\n\t\treturn cb(result);\n\t});\n\treturn result;\n}\nvar allStores = {};\nif (process.env.NODE_ENV === \"development\") {\n\tvar _globalThis, _Store;\n\t(_globalThis = globalThis)[_Store = \"Store\"] || (_globalThis[_Store] = allStores);\n}\nvar emptyObj = {};\nvar selectKeys = function(obj, keys) {\n\tif (!keys.length) return emptyObj;\n\tvar res = {};\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar key = _step.value;\n\t\t\tres[key] = obj[key];\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn res;\n};\nvar isInReaction = false;\nvar setIsInReaction = function(val) {\n\tisInReaction = val;\n};\nfunction useStoreFromInfo(info, userSelector, options) {\n\tvar store = info === null || info === void 0 ? void 0 : info.store;\n\tvar internal = import_react.default.useRef(void 0);\n\tvar component = (0, import_useStoreDebug.useCurrentComponent)();\n\tif (!internal.current) internal.current = {\n\t\tcomponent,\n\t\ttracked: /* @__PURE__ */ new Set(),\n\t\tlast: null,\n\t\tlastKeys: null\n\t};\n\tvar curInternal = internal.current;\n\tvar shouldPrintDebug = options === null || options === void 0 ? void 0 : options.debug;\n\tvar getSnapshot = import_react.default.useCallback(function() {\n\t\tif (!info || !store) return;\n\t\tvar curInternal2 = internal.current;\n\t\tvar isTracking = curInternal2.tracked.size;\n\t\tvar keys = [...!isTracking ? info.stateKeys : curInternal2.tracked];\n\t\tvar nextKeys = `${info.version}${keys.join(\"\")}${userSelector || \"\"}`;\n\t\tvar lastKeys = curInternal2.lastKeys;\n\t\tif (nextKeys === curInternal2.lastKeys) return curInternal2.last;\n\t\tcurInternal2.lastKeys = nextKeys;\n\t\tvar snap;\n\t\tinfo.disableTracking = true;\n\t\tvar last = curInternal2.last;\n\t\tif (userSelector) snap = userSelector(store);\n\t\telse snap = selectKeys(store, keys);\n\t\tinfo.disableTracking = false;\n\t\tvar isUnchanged = !userSelector && !isTracking && last || typeof last !== \"undefined\" && (0, import_comparators.isEqualSubsetShallow)(last, snap, { keyComparators: info.keyComparators });\n\t\tif (shouldPrintDebug) console.info(\"🌑 getSnapshot\", {\n\t\t\tstoreState: selectKeys(store, Object.keys(store)),\n\t\t\tuserSelector,\n\t\t\tinfo,\n\t\t\tisUnchanged,\n\t\t\tcomponent,\n\t\t\tkeys,\n\t\t\tlast,\n\t\t\tsnap,\n\t\t\tcurInternal: curInternal2,\n\t\t\tnextKeys,\n\t\t\tlastKeys\n\t\t});\n\t\tif (isUnchanged) return last;\n\t\tcurInternal2.last = snap;\n\t\treturn snap;\n\t}, [store]);\n\tvar state = import_react.default.useSyncExternalStore((info === null || info === void 0 ? void 0 : info.subscribe) || idFn, getSnapshot, getSnapshot);\n\tif (!info || !store || !state) return state;\n\tif (userSelector) return state;\n\treturn new Proxy(store, { get(target, key) {\n\t\tvar curVal = Reflect.get(target, key);\n\t\tif (isInReaction) return curVal;\n\t\tvar keyString = key;\n\t\tif (info.stateKeys.has(keyString) || keyString in info.getters) {\n\t\t\tif (shouldPrintDebug) console.info(\"👀 tracking\", keyString);\n\t\t\tcurInternal.tracked.add(keyString);\n\t\t}\n\t\tif (Reflect.has(state, key)) return Reflect.get(state, key);\n\t\treturn curVal;\n\t} });\n}\nvar setters = /* @__PURE__ */ new Set();\nvar logStack = /* @__PURE__ */ new Set();\nfunction createProxiedStore(storeInfo) {\n\tvar _loop = function(key2) {\n\t\tif (key2 === \"subscribe\") return \"continue\";\n\t\tvar actionFn = actions[key2];\n\t\tvar isGetFn = key2.startsWith(\"get\");\n\t\twrappedActions[key2] = function useStoreAction() {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\t\t\tvar res;\n\t\t\tif (isGetFn || gettersState.isGetting) return Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) startAction\", key2);\n\t\t\tres = Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (_instanceof(res, Promise)) return res.then(finishAction);\n\t\t\tfinishAction();\n\t\t\treturn res;\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\tlet hashCode2 = function(str) {\n\t\t\t\tvar hash = 0;\n\t\t\t\tfor (var i = 0; i < str.length; i++) hash = str.charCodeAt(i) + ((hash << 5) - hash);\n\t\t\t\treturn hash;\n\t\t\t}, strColor2 = function(str) {\n\t\t\t\treturn `hsl(${hashCode2(str) % 360}, 90%, 40%)`;\n\t\t\t};\n\t\t\tif (!key2.startsWith(\"get\") && !key2.startsWith(\"_\") && key2 !== \"subscribe\") {\n\t\t\t\tvar ogAction = wrappedActions[key2];\n\t\t\t\twrappedActions[key2] = new Proxy(ogAction, { apply(target, thisArg, args) {\n\t\t\t\t\tvar isDebugging = shouldDebug2 || storeInfo.debug;\n\t\t\t\t\tif (!(process.env.LOG_LEVEL !== \"0\" && (isDebugging || import_configureUseStore.configureOpts.logLevel !== \"error\"))) return Reflect.apply(target, thisArg, args);\n\t\t\t\t\tsetters = /* @__PURE__ */ new Set();\n\t\t\t\t\tvar curSetters = setters;\n\t\t\t\t\tvar isTopLevelLogger = logStack.size == 0;\n\t\t\t\t\tvar logs = /* @__PURE__ */ new Set();\n\t\t\t\t\tlogStack.add(logs);\n\t\t\t\t\tvar res;\n\t\t\t\t\tvar id = counter++;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tres = Reflect.apply(target, thisArg, args);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(\"Error\", err);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tlogStack.add(\"end\");\n\t\t\t\t\t\tvar name = constr.name;\n\t\t\t\t\t\tvar color = strColor2(name);\n\t\t\t\t\t\tvar simpleArgs = args.map(import_helpers.simpleStr);\n\t\t\t\t\t\tlogs.add([\n\t\t\t\t\t\t\t`%c \\u{1F311} ${id} ${name.padStart(isTopLevelLogger ? 8 : 4)}%c.${key2}(${simpleArgs.join(\", \")})${isTopLevelLogger && logStack.size > 1 ? ` (+${logStack.size - 1})` : \"\"}`,\n\t\t\t\t\t\t\t`color: ${color};`,\n\t\t\t\t\t\t\t\"color: black;\"\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tif (curSetters.size) curSetters.forEach(function(param) {\n\t\t\t\t\t\t\tvar { key: key3, value } = param;\n\t\t\t\t\t\t\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") logs.add([` SET ${key3} ${value}`, value]);\n\t\t\t\t\t\t\telse logs.add([` SET ${key3}`, value]);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (isTopLevelLogger) {\n\t\t\t\t\t\t\tvar error = null;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tfor (var _iterator = logStack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\t\t\t\t\t\tvar item = _step.value;\n\t\t\t\t\t\t\t\t\t\tif (item === \"end\") {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvar [head, ...rest] = item;\n\t\t\t\t\t\t\t\t\t\tif (head) {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(...head);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"...\");\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(\"args\", args);\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(\"response\", res);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"trace\");\n\t\t\t\t\t\t\t\t\t\t\tconsole.trace();\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var _iterator1 = rest[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar [name1, ...log] = _step1.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(name1);\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.info(...log);\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t\t\t\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else console.info(\"Weird log\", head, ...rest);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t\t\t\t\t_iteratorError = err;\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\terror = err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfor (var _iterator2 = logStack[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\t\t\t\t\t\t_step2.value;\n\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t_didIteratorError2 = true;\n\t\t\t\t\t\t\t\t_iteratorError2 = err;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (error) console.error(`error loggin`, error);\n\t\t\t\t\t\t\tlogStack.clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t};\n\tvar { actions, storeInstance, getters, gettersState } = storeInfo;\n\tvar { getCache, curGetKeys, depsToGetter } = gettersState;\n\tvar constr = storeInstance.constructor;\n\tvar _storeInfo_debug;\n\tvar shouldDebug2 = (_storeInfo_debug = storeInfo.debug) !== null && _storeInfo_debug !== void 0 ? _storeInfo_debug : import_useStoreDebug.DebugStores.has(constr);\n\tvar didSet = false;\n\tvar wrappedActions = {};\n\tfor (var key in actions) _loop(key);\n\tvar finishAction = function(val) {\n\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) finishAction\", { didSet });\n\t\tif (didSet) {\n\t\t\tstoreInfo.triggerUpdate();\n\t\t\tdidSet = false;\n\t\t}\n\t\treturn val;\n\t};\n\tvar isTriggering = false;\n\tvar proxiedStore = new Proxy(storeInstance, {\n\t\tget(_, key2) {\n\t\t\tif (key2 in wrappedActions) return wrappedActions[key2];\n\t\t\tif (key2 in passThroughKeys) return Reflect.get(storeInstance, key2);\n\t\t\tif (key2 === import_constants.UNWRAP_PROXY) return storeInstance;\n\t\t\tif (key2 === import_helpers.UNWRAP_STORE_INFO) return storeInfo;\n\t\t\tif (storeAccessTrackers.size) storeAccessTrackers.forEach(function(cb) {\n\t\t\t\treturn cb(storeInfo);\n\t\t\t});\n\t\t\tif (typeof key2 !== \"string\") return Reflect.get(storeInstance, key2);\n\t\t\tif (!storeInfo.disableTracking) {\n\t\t\t\tif (gettersState.isGetting) gettersState.curGetKeys.add(key2);\n\t\t\t}\n\t\t\tif (key2 in getters) {\n\t\t\t\tif (getCache.has(key2)) return getCache.get(key2);\n\t\t\t\tcurGetKeys.clear();\n\t\t\t\tvar isSubGetter = gettersState.isGetting;\n\t\t\t\tgettersState.isGetting = true;\n\t\t\t\tvar res = getters[key2].call(proxiedStore);\n\t\t\t\tif (!isSubGetter) gettersState.isGetting = false;\n\t\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator = curGetKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\t\tvar gk = _step.value;\n\t\t\t\t\t\tif (!depsToGetter.has(gk)) depsToGetter.set(gk, /* @__PURE__ */ new Set());\n\t\t\t\t\t\tdepsToGetter.get(gk).add(key2);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t_iteratorError = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgetCache.set(key2, res);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\treturn Reflect.get(storeInstance, key2);\n\t\t},\n\t\tset(target, key2, value, receiver) {\n\t\t\tvar cur = Reflect.get(target, key2);\n\t\t\tvar res = Reflect.set(target, key2, value, receiver);\n\t\t\tif (res && cur !== value) {\n\t\t\t\tif (typeof key2 === \"string\") {\n\t\t\t\t\tclearGetterCache(key2);\n\t\t\t\t\tif (shouldDebug2) {\n\t\t\t\t\t\tsetters.add({\n\t\t\t\t\t\t\tkey: key2,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (getShouldDebug(storeInfo)) console.info(\"(debug) SET\", res, key2, value);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"SET...\", {\n\t\t\t\t\t\tkey: key2,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (!isTriggering) {\n\t\t\t\t\tisTriggering = true;\n\t\t\t\t\twaitForEventLoop(function() {\n\t\t\t\t\t\tstoreInfo.triggerUpdate();\n\t\t\t\t\t\tisTriggering = false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t});\n\tfunction clearGetterCache(setKey) {\n\t\tvar parentGetters = depsToGetter.get(setKey);\n\t\tgetCache.delete(setKey);\n\t\tif (!parentGetters) return;\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = parentGetters[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar gk = _step.value;\n\t\t\t\tgetCache.delete(gk);\n\t\t\t\tif (depsToGetter.has(gk)) clearGetterCache(gk);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\treturn proxiedStore;\n}\nvar waitForEventLoop = (process.env.NODE_ENV, function(cb) {\n\treturn cb();\n});\nvar counter = 0;\nvar passThroughKeys = {\n\tsubscribe: true,\n\t_version: true,\n\t_trackers: true,\n\t$$typeof: true,\n\t_listeners: true,\n\t_enableTracking: true\n};\nfunction getShouldDebug(storeInfo) {\n\tvar info = { storeInstance: storeInfo.store };\n\treturn [...storeInfo.trackers].some(function(tracker) {\n\t\treturn tracker.component && (0, import_useStoreDebug.shouldDebug)(tracker.component, info);\n\t});\n}\n//# sourceMappingURL=useStore.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAA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Y,cAAc,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IAC/J,IAAI,KAAK,MAAM;IACf,SAAS,OAAO,EAAE;IAClB,IAAI,aAAa,IAAI,EAAE,GAAG,iBAAiB,EAAE;GAC9C;EACD,SAAS,KAAK;GACb,oBAAoB;GACpB,iBAAiB;EAClB,UAAU;GACT,IAAI;IACH,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM,UAAU,OAAO;GAC9E,UAAU;IACT,IAAI,mBAAmB,MAAM;GAC9B;EACD;CACD;CACA,OAAO;AACR;AACA,IAAI,oBAAoB,QAAQ,IAAI,UAAU,SAAS,IAAI;CAC1D,OAAO,GAAG;AACX;AACA,IAAI,UAAU;AACd,IAAI,kBAAkB;CACrB,WAAW;CACX,UAAU;CACV,WAAW;CACX,UAAU;CACV,YAAY;CACZ,iBAAiB;AAClB;AACA,SAAS,eAAe,WAAW;CAClC,IAAI,OAAO,EAAE,eAAe,UAAU,MAAM;CAC5C,OAAO,CAAC,GAAG,UAAU,QAAQ,CAAC,CAAC,KAAK,SAAS,SAAS;EACrD,OAAO,QAAQ,cAAc,GAAG,qBAAqB,YAAW,CAAE,QAAQ,WAAW,IAAI;CAC1F,CAAC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStoreDebug.native.js","names":[],"sources":["cjs/useStoreDebug.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useStoreDebug_exports = {};\n__export(useStoreDebug_exports, {\n DebugComponents: () => DebugComponents,\n DebugStores: () => DebugStores,\n shouldDebug: () => shouldDebug,\n useCurrentComponent: () => useCurrentComponent,\n useDebugStoreComponent: () => useDebugStoreComponent\n});\nmodule.exports = __toCommonJS(useStoreDebug_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar useCurrentComponent = function() {\n return {};\n};\nfunction useDebugStoreComponent(StoreCons) {\n var cmp = useCurrentComponent();\n DebugStores.add(StoreCons);\n if (!DebugComponents.has(cmp)) {\n DebugComponents.set(cmp, /* @__PURE__ */ new Set());\n }\n var stores = DebugComponents.get(cmp);\n stores.add(StoreCons);\n import_react.default.useLayoutEffect(function() {\n return function() {\n DebugStores.delete(StoreCons);\n stores.delete(StoreCons);\n };\n }, []);\n}\nvar shouldDebug = function(component, info) {\n var _info_storeInstance, _DebugComponents_get;\n var StoreCons = (_info_storeInstance = info.storeInstance) === null || _info_storeInstance === void 0 ? void 0 : _info_storeInstance.constructor;\n return (_DebugComponents_get = DebugComponents.get(component)) === null || _DebugComponents_get === void 0 ? void 0 : _DebugComponents_get.has(StoreCons);\n};\nvar DebugComponents = /* @__PURE__ */ new Map();\nvar DebugStores = /* @__PURE__ */ new Set();\n//# sourceMappingURL=useStoreDebug.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useStoreDebug.native.js","names":[],"sources":["cjs/useStoreDebug.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar useStoreDebug_exports = {};\n__export(useStoreDebug_exports, {\n DebugComponents: () => DebugComponents,\n DebugStores: () => DebugStores,\n shouldDebug: () => shouldDebug,\n useCurrentComponent: () => useCurrentComponent,\n useDebugStoreComponent: () => useDebugStoreComponent\n});\nmodule.exports = __toCommonJS(useStoreDebug_exports);\nvar import_react = __toESM(require(\"react\"), 1);\nvar useCurrentComponent = function() {\n return {};\n};\nfunction useDebugStoreComponent(StoreCons) {\n var cmp = useCurrentComponent();\n DebugStores.add(StoreCons);\n if (!DebugComponents.has(cmp)) {\n DebugComponents.set(cmp, /* @__PURE__ */ new Set());\n }\n var stores = DebugComponents.get(cmp);\n stores.add(StoreCons);\n import_react.default.useLayoutEffect(function() {\n return function() {\n DebugStores.delete(StoreCons);\n stores.delete(StoreCons);\n };\n }, []);\n}\nvar shouldDebug = function(component, info) {\n var _info_storeInstance, _DebugComponents_get;\n var StoreCons = (_info_storeInstance = info.storeInstance) === null || _info_storeInstance === void 0 ? void 0 : _info_storeInstance.constructor;\n return (_DebugComponents_get = DebugComponents.get(component)) === null || _DebugComponents_get === void 0 ? void 0 : _DebugComponents_get.has(StoreCons);\n};\nvar DebugComponents = /* @__PURE__ */ new Map();\nvar DebugStores = /* @__PURE__ */ new Set();\n//# sourceMappingURL=useStoreDebug.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB;CAC9B,uBAAuB;CACvB,mBAAmB;CACnB,mBAAmB;CACnB,2BAA2B;CAC3B,8BAA8B;AAChC,CAAC;AACD,OAAO,UAAU,aAAa,qBAAqB;AACnD,IAAI,eAAe,QAAQ,QAAQ,OAAO,GAAG,CAAC;AAC9C,IAAI,sBAAsB,WAAW;CACnC,OAAO,CAAC;AACV;AACA,SAAS,uBAAuB,WAAW;CACzC,IAAI,MAAM,oBAAoB;CAC9B,YAAY,IAAI,SAAS;CACzB,IAAI,CAAC,gBAAgB,IAAI,GAAG,GAAG;EAC7B,gBAAgB,IAAI,qBAAqB,IAAI,IAAI,CAAC;CACpD;CACA,IAAI,SAAS,gBAAgB,IAAI,GAAG;CACpC,OAAO,IAAI,SAAS;CACpB,aAAa,QAAQ,gBAAgB,WAAW;EAC9C,OAAO,WAAW;GAChB,YAAY,OAAO,SAAS;GAC5B,OAAO,OAAO,SAAS;EACzB;CACF,GAAG,CAAC,CAAC;AACP;AACA,IAAI,cAAc,SAAS,WAAW,MAAM;CAC1C,IAAI,qBAAqB;CACzB,IAAI,aAAa,sBAAsB,KAAK,mBAAmB,QAAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB;CACrI,QAAQ,uBAAuB,gBAAgB,IAAI,SAAS,OAAO,QAAQ,yBAAyB,KAAK,IAAI,KAAK,IAAI,qBAAqB,IAAI,SAAS;AAC1J;AACA,IAAI,kCAAkC,IAAI,IAAI;AAC9C,IAAI,8BAA8B,IAAI,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","names":[],"sources":["esm/decorators.js"],"sourcesContent":["function compare(comparator) {\n return (target, propertyKey) => {\n target[\"_comparators\"] = target[\"_comparators\"] || {};\n target[\"_comparators\"][propertyKey] = comparator;\n };\n}\nexport {\n compare\n};\n//# sourceMappingURL=decorators.js.map\n"],"mappings":";AAAA,SAAS,QAAQ,YAAY;CAC3B,QAAQ,QAAQ,gBAAgB;EAC9B,OAAO,kBAAkB,OAAO,mBAAmB,CAAC;EACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"decorators.js","names":[],"sources":["esm/decorators.js"],"sourcesContent":["function compare(comparator) {\n return (target, propertyKey) => {\n target[\"_comparators\"] = target[\"_comparators\"] || {};\n target[\"_comparators\"][propertyKey] = comparator;\n };\n}\nexport {\n compare\n};\n//# sourceMappingURL=decorators.js.map\n"],"mappings":";AAAA,SAAS,QAAQ,YAAY;CAC3B,QAAQ,QAAQ,gBAAgB;EAC9B,OAAO,kBAAkB,OAAO,mBAAmB,CAAC;EACpD,OAAO,eAAe,CAAC,eAAe;CACxC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.native.js","names":[],"sources":["esm/decorators.native.js"],"sourcesContent":["function compare(comparator) {\n return function(target, propertyKey) {\n target[\"_comparators\"] = target[\"_comparators\"] || {};\n target[\"_comparators\"][propertyKey] = comparator;\n };\n}\nexport {\n compare\n};\n//# sourceMappingURL=decorators.js.map\n"],"mappings":";AAAA,SAAS,QAAQ,YAAY;CAC3B,OAAO,SAAS,QAAQ,aAAa;EACnC,OAAO,kBAAkB,OAAO,mBAAmB,CAAC;EACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"decorators.native.js","names":[],"sources":["esm/decorators.native.js"],"sourcesContent":["function compare(comparator) {\n return function(target, propertyKey) {\n target[\"_comparators\"] = target[\"_comparators\"] || {};\n target[\"_comparators\"][propertyKey] = comparator;\n };\n}\nexport {\n compare\n};\n//# sourceMappingURL=decorators.js.map\n"],"mappings":";AAAA,SAAS,QAAQ,YAAY;CAC3B,OAAO,SAAS,QAAQ,aAAa;EACnC,OAAO,kBAAkB,OAAO,mBAAmB,CAAC;EACpD,OAAO,eAAe,CAAC,eAAe;CACxC;AACF"}
|
package/dist/esm/observe.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.js","names":[],"sources":["esm/observe.js"],"sourcesContent":["import React from \"react\";\nimport { isEqualSubsetShallow } from \"./comparators\";\nimport { UNWRAP_PROXY } from \"./constants\";\nimport { trackStoresAccess } from \"./useStore\";\nconst logUpdate = process.env.NODE_ENV === \"development\" ? (fn, stores, last, next) => {\n const getStoreLogName = (store) => {\n const str = store[UNWRAP_PROXY] ?? store;\n return `${str.constructor.name}${store.props?.id ? `:${store.props.id}` : \"\"}`;\n };\n const storeNames = stores.map(getStoreLogName).join(\", \");\n const name = `\\u{1F311} \\u25B6\\uFE0F %c${fn.name} ${storeNames} () ${last} => ${next}`;\n console.groupCollapsed(name, \"color: tomato;\");\n console.groupCollapsed(\"trace >\");\n console.trace();\n console.groupEnd();\n console.info(\" next\", next);\n console.groupEnd();\n} : null;\nfunction observe(fn) {\n let prev = getObserverValueAndStoresAccessed(fn);\n let disposeValue = null;\n const subscribe = () => {\n const stores = [...prev.storeInfos];\n return subscribeToStores(stores, () => {\n disposeValue?.();\n const next = getObserverValueAndStoresAccessed(fn);\n if (typeof next.value === \"function\") {\n disposeValue = next.value;\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [...next.storeInfos], \"(fn)\", \"(fn)\");\n }\n return;\n }\n if (isEqualSubsetShallow(prev.storeInfos, next.storeInfos) && isEqualSubsetShallow(prev.value, next.value)) {\n return;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [...next.storeInfos], prev.value, next.value);\n }\n prev = next;\n dispose();\n dispose = subscribe();\n });\n };\n let dispose = subscribe();\n return {\n dispose: () => {\n dispose();\n disposeValue?.();\n },\n getValue: () => prev.value\n };\n}\nfunction useObserve(fn) {\n const [state, setState] = React.useState(() => {\n return getObserverValueAndStoresAccessed(fn);\n });\n React.useEffect(() => {\n let dispose;\n const unsub = subscribeToStores([...state.storeInfos], () => {\n dispose?.();\n const next = getObserverValueAndStoresAccessed(fn);\n const nextStoreInfos = [...next.storeInfos];\n const prevStoreInfos = [...state.storeInfos];\n if (typeof next.value === \"function\") {\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, \"(fn)\", \"(fn)\");\n }\n dispose = next.value;\n return;\n }\n setState((prev) => {\n if (isEqualSubsetShallow(prevStoreInfos, nextStoreInfos) && isEqualSubsetShallow(prev.value, next.value)) {\n return prev;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, prev.value, next.value);\n }\n return next;\n });\n });\n return () => {\n unsub();\n dispose?.();\n };\n }, [[...state.storeInfos].map((i) => i.uid).join(\",\")]);\n return state.value;\n}\nfunction getObserverValueAndStoresAccessed(selector) {\n const storeInfos = /* @__PURE__ */ new Set();\n const dispose = trackStoresAccess((storeInfo) => {\n storeInfos.add(storeInfo);\n });\n const value = selector();\n dispose();\n return {\n value,\n storeInfos\n };\n}\nfunction subscribeToStores(storeInfos, onUpdate) {\n const disposes = [];\n let isUpdating = false;\n const onUpdateDebouncedWithoutTracking = () => {\n if (isUpdating) return;\n isUpdating = true;\n queueMicrotask(() => {\n try {\n for (const storeInfo of storeInfos) {\n storeInfo.disableTracking = true;\n }\n onUpdate();\n } finally {\n isUpdating = false;\n for (const storeInfo of storeInfos) {\n storeInfo.disableTracking = false;\n }\n }\n });\n };\n for (const storeInfo of storeInfos) {\n disposes.push(storeInfo.subscribe(onUpdateDebouncedWithoutTracking));\n }\n return () => {\n disposes.forEach((x) => x());\n };\n}\nexport {\n observe,\n useObserve\n};\n//# sourceMappingURL=observe.js.map\n"],"mappings":";;;;;;AAIA,MAAM,YAAY,QAAQ,IAAI,aAAa,iBAAiB,IAAI,QAAQ,MAAM,SAAS;CACrF,MAAM,mBAAmB,UAAU;EACjC,MAAM,MAAM,MAAM,iBAAiB;EACnC,OAAO,GAAG,IAAI,YAAY,OAAO,MAAM,OAAO,KAAK,IAAI,MAAM,MAAM,OAAO;CAC5E;CACA,MAAM,aAAa,OAAO,IAAI,eAAe,
|
|
1
|
+
{"version":3,"file":"observe.js","names":[],"sources":["esm/observe.js"],"sourcesContent":["import React from \"react\";\nimport { isEqualSubsetShallow } from \"./comparators\";\nimport { UNWRAP_PROXY } from \"./constants\";\nimport { trackStoresAccess } from \"./useStore\";\nconst logUpdate = process.env.NODE_ENV === \"development\" ? (fn, stores, last, next) => {\n const getStoreLogName = (store) => {\n const str = store[UNWRAP_PROXY] ?? store;\n return `${str.constructor.name}${store.props?.id ? `:${store.props.id}` : \"\"}`;\n };\n const storeNames = stores.map(getStoreLogName).join(\", \");\n const name = `\\u{1F311} \\u25B6\\uFE0F %c${fn.name} ${storeNames} () ${last} => ${next}`;\n console.groupCollapsed(name, \"color: tomato;\");\n console.groupCollapsed(\"trace >\");\n console.trace();\n console.groupEnd();\n console.info(\" next\", next);\n console.groupEnd();\n} : null;\nfunction observe(fn) {\n let prev = getObserverValueAndStoresAccessed(fn);\n let disposeValue = null;\n const subscribe = () => {\n const stores = [...prev.storeInfos];\n return subscribeToStores(stores, () => {\n disposeValue?.();\n const next = getObserverValueAndStoresAccessed(fn);\n if (typeof next.value === \"function\") {\n disposeValue = next.value;\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [...next.storeInfos], \"(fn)\", \"(fn)\");\n }\n return;\n }\n if (isEqualSubsetShallow(prev.storeInfos, next.storeInfos) && isEqualSubsetShallow(prev.value, next.value)) {\n return;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [...next.storeInfos], prev.value, next.value);\n }\n prev = next;\n dispose();\n dispose = subscribe();\n });\n };\n let dispose = subscribe();\n return {\n dispose: () => {\n dispose();\n disposeValue?.();\n },\n getValue: () => prev.value\n };\n}\nfunction useObserve(fn) {\n const [state, setState] = React.useState(() => {\n return getObserverValueAndStoresAccessed(fn);\n });\n React.useEffect(() => {\n let dispose;\n const unsub = subscribeToStores([...state.storeInfos], () => {\n dispose?.();\n const next = getObserverValueAndStoresAccessed(fn);\n const nextStoreInfos = [...next.storeInfos];\n const prevStoreInfos = [...state.storeInfos];\n if (typeof next.value === \"function\") {\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, \"(fn)\", \"(fn)\");\n }\n dispose = next.value;\n return;\n }\n setState((prev) => {\n if (isEqualSubsetShallow(prevStoreInfos, nextStoreInfos) && isEqualSubsetShallow(prev.value, next.value)) {\n return prev;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, prev.value, next.value);\n }\n return next;\n });\n });\n return () => {\n unsub();\n dispose?.();\n };\n }, [[...state.storeInfos].map((i) => i.uid).join(\",\")]);\n return state.value;\n}\nfunction getObserverValueAndStoresAccessed(selector) {\n const storeInfos = /* @__PURE__ */ new Set();\n const dispose = trackStoresAccess((storeInfo) => {\n storeInfos.add(storeInfo);\n });\n const value = selector();\n dispose();\n return {\n value,\n storeInfos\n };\n}\nfunction subscribeToStores(storeInfos, onUpdate) {\n const disposes = [];\n let isUpdating = false;\n const onUpdateDebouncedWithoutTracking = () => {\n if (isUpdating) return;\n isUpdating = true;\n queueMicrotask(() => {\n try {\n for (const storeInfo of storeInfos) {\n storeInfo.disableTracking = true;\n }\n onUpdate();\n } finally {\n isUpdating = false;\n for (const storeInfo of storeInfos) {\n storeInfo.disableTracking = false;\n }\n }\n });\n };\n for (const storeInfo of storeInfos) {\n disposes.push(storeInfo.subscribe(onUpdateDebouncedWithoutTracking));\n }\n return () => {\n disposes.forEach((x) => x());\n };\n}\nexport {\n observe,\n useObserve\n};\n//# sourceMappingURL=observe.js.map\n"],"mappings":";;;;;;AAIA,MAAM,YAAY,QAAQ,IAAI,aAAa,iBAAiB,IAAI,QAAQ,MAAM,SAAS;CACrF,MAAM,mBAAmB,UAAU;EACjC,MAAM,MAAM,MAAM,iBAAiB;EACnC,OAAO,GAAG,IAAI,YAAY,OAAO,MAAM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AAkB;IAC9B;GACF;EACF,CAAC;CACH;CACA,KAAK,MAAM,aAAa,YAAY;EAClC,SAAS,KAAK,UAAU,UAAU,gCAAgC,CAAC;CACrE;CACA,aAAa;EACX,SAAS,SAAS,MAAM,EAAE,CAAC;CAC7B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.native.js","names":[],"sources":["esm/observe.native.js"],"sourcesContent":["import React from \"react\";\nimport { isEqualSubsetShallow } from \"./comparators\";\nimport { UNWRAP_PROXY } from \"./constants\";\nimport { trackStoresAccess } from \"./useStore\";\nvar logUpdate = process.env.NODE_ENV === \"development\" ? function(fn, stores, last, next) {\n var getStoreLogName = function(store) {\n var _store_props;\n var _store_UNWRAP_PROXY;\n var str = (_store_UNWRAP_PROXY = store[UNWRAP_PROXY]) !== null && _store_UNWRAP_PROXY !== void 0 ? _store_UNWRAP_PROXY : store;\n return `${str.constructor.name}${((_store_props = store.props) === null || _store_props === void 0 ? void 0 : _store_props.id) ? `:${store.props.id}` : \"\"}`;\n };\n var storeNames = stores.map(getStoreLogName).join(\", \");\n var name = `\\u{1F311} \\u25B6\\uFE0F %c${fn.name} ${storeNames} () ${last} => ${next}`;\n console.groupCollapsed(name, \"color: tomato;\");\n console.groupCollapsed(\"trace >\");\n console.trace();\n console.groupEnd();\n console.info(\" next\", next);\n console.groupEnd();\n} : null;\nfunction observe(fn) {\n var prev = getObserverValueAndStoresAccessed(fn);\n var disposeValue = null;\n var subscribe = function() {\n var stores = [\n ...prev.storeInfos\n ];\n return subscribeToStores(stores, function() {\n disposeValue === null || disposeValue === void 0 ? void 0 : disposeValue();\n var next = getObserverValueAndStoresAccessed(fn);\n if (typeof next.value === \"function\") {\n disposeValue = next.value;\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [\n ...next.storeInfos\n ], \"(fn)\", \"(fn)\");\n }\n return;\n }\n if (isEqualSubsetShallow(prev.storeInfos, next.storeInfos) && isEqualSubsetShallow(prev.value, next.value)) {\n return;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [\n ...next.storeInfos\n ], prev.value, next.value);\n }\n prev = next;\n dispose();\n dispose = subscribe();\n });\n };\n var dispose = subscribe();\n return {\n dispose: function() {\n dispose();\n disposeValue === null || disposeValue === void 0 ? void 0 : disposeValue();\n },\n getValue: function() {\n return prev.value;\n }\n };\n}\nfunction useObserve(fn) {\n var [state, setState] = React.useState(function() {\n return getObserverValueAndStoresAccessed(fn);\n });\n React.useEffect(function() {\n var dispose;\n var unsub = subscribeToStores([\n ...state.storeInfos\n ], function() {\n dispose === null || dispose === void 0 ? void 0 : dispose();\n var next = getObserverValueAndStoresAccessed(fn);\n var nextStoreInfos = [\n ...next.storeInfos\n ];\n var prevStoreInfos = [\n ...state.storeInfos\n ];\n if (typeof next.value === \"function\") {\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, \"(fn)\", \"(fn)\");\n }\n dispose = next.value;\n return;\n }\n setState(function(prev) {\n if (isEqualSubsetShallow(prevStoreInfos, nextStoreInfos) && isEqualSubsetShallow(prev.value, next.value)) {\n return prev;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, prev.value, next.value);\n }\n return next;\n });\n });\n return function() {\n unsub();\n dispose === null || dispose === void 0 ? void 0 : dispose();\n };\n }, [\n [\n ...state.storeInfos\n ].map(function(i) {\n return i.uid;\n }).join(\",\")\n ]);\n return state.value;\n}\nfunction getObserverValueAndStoresAccessed(selector) {\n var storeInfos = /* @__PURE__ */ new Set();\n var dispose = trackStoresAccess(function(storeInfo) {\n storeInfos.add(storeInfo);\n });\n var value = selector();\n dispose();\n return {\n value,\n storeInfos\n };\n}\nfunction subscribeToStores(storeInfos, onUpdate) {\n var disposes = [];\n var isUpdating = false;\n var onUpdateDebouncedWithoutTracking = function() {\n if (isUpdating) return;\n isUpdating = true;\n queueMicrotask(function() {\n try {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = storeInfos[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var storeInfo2 = _step2.value;\n storeInfo2.disableTracking = true;\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n onUpdate();\n } finally {\n isUpdating = false;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = storeInfos[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var storeInfo1 = _step1.value;\n storeInfo1.disableTracking = false;\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n });\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = storeInfos[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var storeInfo = _step.value;\n disposes.push(storeInfo.subscribe(onUpdateDebouncedWithoutTracking));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return function() {\n disposes.forEach(function(x) {\n return x();\n });\n };\n}\nexport {\n observe,\n useObserve\n};\n//# sourceMappingURL=observe.js.map\n"],"mappings":";;;;;;AAIA,IAAI,YAAY,QAAQ,IAAI,aAAa,gBAAgB,SAAS,IAAI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tB,MAAM;MACR;KACF;IACF;GACF;EACF,CAAC;CACH;CACA,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,WAAW,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;GAC3J,IAAI,YAAY,MAAM;GACtB,SAAS,KAAK,UAAU,UAAU,gCAAgC,CAAC;EACrE;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO,WAAW;EAChB,SAAS,QAAQ,SAAS,GAAG;GAC3B,OAAO,EAAE;EACX,CAAC;CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"observe.native.js","names":[],"sources":["esm/observe.native.js"],"sourcesContent":["import React from \"react\";\nimport { isEqualSubsetShallow } from \"./comparators\";\nimport { UNWRAP_PROXY } from \"./constants\";\nimport { trackStoresAccess } from \"./useStore\";\nvar logUpdate = process.env.NODE_ENV === \"development\" ? function(fn, stores, last, next) {\n var getStoreLogName = function(store) {\n var _store_props;\n var _store_UNWRAP_PROXY;\n var str = (_store_UNWRAP_PROXY = store[UNWRAP_PROXY]) !== null && _store_UNWRAP_PROXY !== void 0 ? _store_UNWRAP_PROXY : store;\n return `${str.constructor.name}${((_store_props = store.props) === null || _store_props === void 0 ? void 0 : _store_props.id) ? `:${store.props.id}` : \"\"}`;\n };\n var storeNames = stores.map(getStoreLogName).join(\", \");\n var name = `\\u{1F311} \\u25B6\\uFE0F %c${fn.name} ${storeNames} () ${last} => ${next}`;\n console.groupCollapsed(name, \"color: tomato;\");\n console.groupCollapsed(\"trace >\");\n console.trace();\n console.groupEnd();\n console.info(\" next\", next);\n console.groupEnd();\n} : null;\nfunction observe(fn) {\n var prev = getObserverValueAndStoresAccessed(fn);\n var disposeValue = null;\n var subscribe = function() {\n var stores = [\n ...prev.storeInfos\n ];\n return subscribeToStores(stores, function() {\n disposeValue === null || disposeValue === void 0 ? void 0 : disposeValue();\n var next = getObserverValueAndStoresAccessed(fn);\n if (typeof next.value === \"function\") {\n disposeValue = next.value;\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [\n ...next.storeInfos\n ], \"(fn)\", \"(fn)\");\n }\n return;\n }\n if (isEqualSubsetShallow(prev.storeInfos, next.storeInfos) && isEqualSubsetShallow(prev.value, next.value)) {\n return;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, [\n ...next.storeInfos\n ], prev.value, next.value);\n }\n prev = next;\n dispose();\n dispose = subscribe();\n });\n };\n var dispose = subscribe();\n return {\n dispose: function() {\n dispose();\n disposeValue === null || disposeValue === void 0 ? void 0 : disposeValue();\n },\n getValue: function() {\n return prev.value;\n }\n };\n}\nfunction useObserve(fn) {\n var [state, setState] = React.useState(function() {\n return getObserverValueAndStoresAccessed(fn);\n });\n React.useEffect(function() {\n var dispose;\n var unsub = subscribeToStores([\n ...state.storeInfos\n ], function() {\n dispose === null || dispose === void 0 ? void 0 : dispose();\n var next = getObserverValueAndStoresAccessed(fn);\n var nextStoreInfos = [\n ...next.storeInfos\n ];\n var prevStoreInfos = [\n ...state.storeInfos\n ];\n if (typeof next.value === \"function\") {\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, \"(fn)\", \"(fn)\");\n }\n dispose = next.value;\n return;\n }\n setState(function(prev) {\n if (isEqualSubsetShallow(prevStoreInfos, nextStoreInfos) && isEqualSubsetShallow(prev.value, next.value)) {\n return prev;\n }\n if (process.env.NODE_ENV === \"development\") {\n logUpdate(fn, nextStoreInfos, prev.value, next.value);\n }\n return next;\n });\n });\n return function() {\n unsub();\n dispose === null || dispose === void 0 ? void 0 : dispose();\n };\n }, [\n [\n ...state.storeInfos\n ].map(function(i) {\n return i.uid;\n }).join(\",\")\n ]);\n return state.value;\n}\nfunction getObserverValueAndStoresAccessed(selector) {\n var storeInfos = /* @__PURE__ */ new Set();\n var dispose = trackStoresAccess(function(storeInfo) {\n storeInfos.add(storeInfo);\n });\n var value = selector();\n dispose();\n return {\n value,\n storeInfos\n };\n}\nfunction subscribeToStores(storeInfos, onUpdate) {\n var disposes = [];\n var isUpdating = false;\n var onUpdateDebouncedWithoutTracking = function() {\n if (isUpdating) return;\n isUpdating = true;\n queueMicrotask(function() {\n try {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = storeInfos[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var storeInfo2 = _step2.value;\n storeInfo2.disableTracking = true;\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n onUpdate();\n } finally {\n isUpdating = false;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = storeInfos[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var storeInfo1 = _step1.value;\n storeInfo1.disableTracking = false;\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n });\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = storeInfos[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var storeInfo = _step.value;\n disposes.push(storeInfo.subscribe(onUpdateDebouncedWithoutTracking));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return function() {\n disposes.forEach(function(x) {\n return x();\n });\n };\n}\nexport {\n observe,\n useObserve\n};\n//# sourceMappingURL=observe.js.map\n"],"mappings":";;;;;;AAIA,IAAI,YAAY,QAAQ,IAAI,aAAa,gBAAgB,SAAS,IAAI,QAAQ,MAAM,MAAM;CACxF,IAAI,kBAAkB,SAAS,OAAO;EACpC,IAAI;EACJ,IAAI;EACJ,IAAI,OAAO,sBAAsB,MAAM,mBAAmB,QAAQ,wBAAwB,KAAK,IAAI,sBAAsB;EACzH,OAAO,GAAG,IAAI,YAAY,SAAS,eAAe,MAAM,WAAW,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa,MAAM,IAAI,MAAM,MAAM,OAAO;CAC1J;CACA,IAAI,aAAa,OAAO,IAAI,eAAe,CAAC,CAAC,KAAK,IAAI;CACtD,IAAI,OAAO,6BAA6B,GAAG,KAAK,GAAG,WAAW,MAAM,KAAK,MAAM;CAC/E,QAAQ,eAAe,MAAM,gBAAgB;CAC7C,QAAQ,eAAe,SAAS;CAChC,QAAQ,MAAM;CACd,QAAQ,SAAS;CACjB,QAAQ,KAAK,UAAU,IAAI;CAC3B,QAAQ,SAAS;AACnB,IAAI;AACJ,SAAS,QAAQ,IAAI;CACnB,IAAI,OAAO,kCAAkC,EAAE;CAC/C,IAAI,eAAe;CACnB,IAAI,YAAY,WAAW;EACzB,IAAI,SAAS,CACX,GAAG,KAAK,UACV;EACA,OAAO,kBAAkB,QAAQ,WAAW;GAC1C,iBAAiB,QAAQ,iBAAiB,KAAK,IAAI,KAAK,IAAI,aAAa;GACzE,IAAI,OAAO,kCAAkC,E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UAAU;IACR,aAAa;IACb,IAAI,6BAA6B,MAAM,qBAAqB,OAAO,kBAAkB,KAAK;IAC1F,IAAI;KACF,KAAK,IAAI,aAAa,WAAW,OAAO,SAAS,CAAC,GAAG,QAAQ,EAAE,8BAA8B,SAAS,WAAW,KAAK,EAAC,CAAE,OAAO,6BAA6B,MAAM;MACjK,IAAI,aAAa,OAAO;MACxB,WAAW,kBAAkB;KAC/B;IACF,SAAS,KAAK;KACZ,qBAAqB;KACrB,kBAAkB;IACpB,UAAU;KACR,IAAI;MACF,IAAI,CAAC,8BAA8B,WAAW,UAAU,MAAM;OAC5D,WAAW,OAAO;MACpB;KACF,UAAU;MACR,IAAI,oBAAoB;OACtB,MAAM;MACR;KACF;IACF;GACF;EACF,CAAC;CACH;CACA,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,KAAK,IAAI,YAAY,WAAW,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;GAC3J,IAAI,YAAY,MAAM;GACtB,SAAS,KAAK,UAAU,UAAU,gCAAgC,CAAC;EACrE;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO,WAAW;EAChB,SAAS,QAAQ,SAAS,GAAG;GAC3B,OAAO,EAAE;EACX,CAAC;CACH;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStore.js","names":[],"sources":["esm/useStore.js"],"sourcesContent":["import React from \"react\";\nimport { isEqualSubsetShallow } from \"./comparators\";\nimport { configureOpts } from \"./configureUseStore\";\nimport { UNWRAP_PROXY, defaultOptions } from \"./constants\";\nimport { UNWRAP_STORE_INFO, cache, getStoreDescriptors, getStoreUid, simpleStr } from \"./helpers\";\nimport { DebugStores, shouldDebug, useCurrentComponent } from \"./useStoreDebug\";\n\nconst idFn = (_) => _;\nfunction useStore(StoreKlass, props, options = defaultOptions) {\n\treturn useStoreFromInfo(getOrCreateStoreInfo(StoreKlass, props, options), options.selector, options);\n}\nfunction useStoreDebug(StoreKlass, props) {\n\treturn useStore(StoreKlass, props, { debug: true });\n}\nfunction createStore(StoreKlass, props, options) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, options)?.store;\n}\nfunction useGlobalStore(instance, debug) {\n\tconst store = instance[UNWRAP_PROXY];\n\tconst uid = getStoreUid(store.constructor, store.props);\n\tconst info = cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, void 0, { debug });\n}\nfunction useGlobalStoreSelector(instance, selector, debug) {\n\tconst store = instance[UNWRAP_PROXY];\n\tconst uid = getStoreUid(store.constructor, store.props);\n\tconst info = cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, selector, { debug });\n}\nfunction createUseStore(StoreKlass) {\n\treturn (props, options) => useStore(StoreKlass, props, options);\n}\nfunction createUseStoreSelector(StoreKlass, selector) {\n\treturn (props) => {\n\t\treturn useStore(StoreKlass, props, { selector });\n\t};\n}\nfunction useStoreSelector(StoreKlass, selector, props) {\n\treturn useStore(StoreKlass, props, { selector });\n}\nconst storeAccessTrackers = /* @__PURE__ */ new Set();\nfunction trackStoresAccess(cb) {\n\tstoreAccessTrackers.add(cb);\n\treturn () => {\n\t\tstoreAccessTrackers.delete(cb);\n\t};\n}\nfunction getStore(StoreKlass, props) {\n\treturn getStoreInfo(StoreKlass, props)?.store;\n}\nfunction getOrCreateStore(StoreKlass, props) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: false })?.store;\n}\nfunction getStoreInfo(StoreKlass, props) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: true });\n}\nconst onCreateListeners = /* @__PURE__ */ new Set();\nfunction onCreateStore(cb) {\n\tonCreateListeners.add(cb);\n\treturn () => {\n\t\tonCreateListeners.delete(cb);\n\t};\n}\nfunction getOrCreateStoreInfo(StoreKlass, props, options, propsKeyCalculated) {\n\tif (!StoreKlass) return null;\n\tconst uid = getStoreUid(StoreKlass, propsKeyCalculated ?? props);\n\tif (!options?.avoidCache && cache.has(uid)) return cache.get(uid);\n\tif (options?.refuseCreation) throw new Error(`No store exists (${StoreKlass.name}) with props: ${props}`);\n\tconst storeInstance = new StoreKlass(props);\n\tstoreInstance.props = props;\n\tconst getters = {};\n\tconst actions = {};\n\tconst stateKeys = /* @__PURE__ */ new Set();\n\tconst descriptors = getStoreDescriptors(storeInstance);\n\tfor (const key in descriptors) {\n\t\tconst descriptor = descriptors[key];\n\t\tif (typeof descriptor.value === \"function\") actions[key] = descriptor.value;\n\t\telse if (typeof descriptor.get === \"function\") getters[key] = descriptor.get;\n\t\telse if (key !== \"props\" && key[0] !== \"_\") stateKeys.add(key);\n\t}\n\tconst keyComparators = storeInstance[\"_comparators\"];\n\tconst listeners = /* @__PURE__ */ new Set();\n\tconst storeInfo = {\n\t\tuid,\n\t\tkeyComparators,\n\t\tstoreInstance,\n\t\tgetters,\n\t\tstateKeys,\n\t\tprops,\n\t\tactions,\n\t\tdebug: options?.debug,\n\t\tdisableTracking: false,\n\t\tgettersState: {\n\t\t\tgetCache: /* @__PURE__ */ new Map(),\n\t\t\tdepsToGetter: /* @__PURE__ */ new Map(),\n\t\t\tcurGetKeys: /* @__PURE__ */ new Set(),\n\t\t\tisGetting: false\n\t\t},\n\t\tlisteners,\n\t\ttrackers: /* @__PURE__ */ new Set(),\n\t\tversion: 0,\n\t\tsubscribe: (onChanged) => {\n\t\t\tlisteners.add(onChanged);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(onChanged);\n\t\t\t};\n\t\t},\n\t\ttriggerUpdate: () => {\n\t\t\tstoreInfo.version = (storeInfo.version + 1) % Number.MAX_SAFE_INTEGER;\n\t\t\tfor (const cb of listeners) cb();\n\t\t}\n\t};\n\tconst store = createProxiedStore(storeInfo);\n\tif (process.env.NODE_ENV === \"development\") allStores[StoreKlass.name + uid] = store;\n\tstore.mount?.();\n\tstoreInfo.store = store;\n\tconst result = storeInfo;\n\tcache.set(uid, result);\n\tonCreateListeners.forEach((cb) => cb(result));\n\treturn result;\n}\nconst allStores = {};\nif (process.env.NODE_ENV === \"development\") globalThis[\"Store\"] ||= allStores;\nconst emptyObj = {};\nconst selectKeys = (obj, keys) => {\n\tif (!keys.length) return emptyObj;\n\tconst res = {};\n\tfor (const key of keys) res[key] = obj[key];\n\treturn res;\n};\nlet isInReaction = false;\nconst setIsInReaction = (val) => {\n\tisInReaction = val;\n};\nfunction useStoreFromInfo(info, userSelector, options) {\n\tconst store = info?.store;\n\tconst internal = React.useRef(void 0);\n\tconst component = useCurrentComponent();\n\tif (!internal.current) internal.current = {\n\t\tcomponent,\n\t\ttracked: /* @__PURE__ */ new Set(),\n\t\tlast: null,\n\t\tlastKeys: null\n\t};\n\tconst curInternal = internal.current;\n\tconst shouldPrintDebug = options?.debug;\n\tconst getSnapshot = React.useCallback(() => {\n\t\tif (!info || !store) return;\n\t\tconst curInternal2 = internal.current;\n\t\tconst isTracking = curInternal2.tracked.size;\n\t\tconst keys = [...!isTracking ? info.stateKeys : curInternal2.tracked];\n\t\tconst nextKeys = `${info.version}${keys.join(\"\")}${userSelector || \"\"}`;\n\t\tconst lastKeys = curInternal2.lastKeys;\n\t\tif (nextKeys === curInternal2.lastKeys) return curInternal2.last;\n\t\tcurInternal2.lastKeys = nextKeys;\n\t\tlet snap;\n\t\tinfo.disableTracking = true;\n\t\tconst last = curInternal2.last;\n\t\tif (userSelector) snap = userSelector(store);\n\t\telse snap = selectKeys(store, keys);\n\t\tinfo.disableTracking = false;\n\t\tconst isUnchanged = !userSelector && !isTracking && last || typeof last !== \"undefined\" && isEqualSubsetShallow(last, snap, { keyComparators: info.keyComparators });\n\t\tif (shouldPrintDebug) console.info(\"🌑 getSnapshot\", {\n\t\t\tstoreState: selectKeys(store, Object.keys(store)),\n\t\t\tuserSelector,\n\t\t\tinfo,\n\t\t\tisUnchanged,\n\t\t\tcomponent,\n\t\t\tkeys,\n\t\t\tlast,\n\t\t\tsnap,\n\t\t\tcurInternal: curInternal2,\n\t\t\tnextKeys,\n\t\t\tlastKeys\n\t\t});\n\t\tif (isUnchanged) return last;\n\t\tcurInternal2.last = snap;\n\t\treturn snap;\n\t}, [store]);\n\tconst state = React.useSyncExternalStore(info?.subscribe || idFn, getSnapshot, getSnapshot);\n\tif (!info || !store || !state) return state;\n\tif (userSelector) return state;\n\treturn new Proxy(store, { get(target, key) {\n\t\tconst curVal = Reflect.get(target, key);\n\t\tif (isInReaction) return curVal;\n\t\tconst keyString = key;\n\t\tif (info.stateKeys.has(keyString) || keyString in info.getters) {\n\t\t\tif (shouldPrintDebug) console.info(\"👀 tracking\", keyString);\n\t\t\tcurInternal.tracked.add(keyString);\n\t\t}\n\t\tif (Reflect.has(state, key)) return Reflect.get(state, key);\n\t\treturn curVal;\n\t} });\n}\nlet setters = /* @__PURE__ */ new Set();\nconst logStack = /* @__PURE__ */ new Set();\nfunction createProxiedStore(storeInfo) {\n\tconst { actions, storeInstance, getters, gettersState } = storeInfo;\n\tconst { getCache, curGetKeys, depsToGetter } = gettersState;\n\tconst constr = storeInstance.constructor;\n\tconst shouldDebug2 = storeInfo.debug ?? DebugStores.has(constr);\n\tlet didSet = false;\n\tconst wrappedActions = {};\n\tfor (const key in actions) {\n\t\tif (key === \"subscribe\") continue;\n\t\tconst actionFn = actions[key];\n\t\tconst isGetFn = key.startsWith(\"get\");\n\t\twrappedActions[key] = function useStoreAction(...args) {\n\t\t\tlet res;\n\t\t\tif (isGetFn || gettersState.isGetting) return Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) startAction\", key);\n\t\t\tres = Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (res instanceof Promise) return res.then(finishAction);\n\t\t\tfinishAction();\n\t\t\treturn res;\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\tlet hashCode = function(str) {\n\t\t\t\tlet hash = 0;\n\t\t\t\tfor (let i = 0; i < str.length; i++) hash = str.charCodeAt(i) + ((hash << 5) - hash);\n\t\t\t\treturn hash;\n\t\t\t}, strColor = function(str) {\n\t\t\t\treturn `hsl(${hashCode(str) % 360}, 90%, 40%)`;\n\t\t\t};\n\t\t\tif (!key.startsWith(\"get\") && !key.startsWith(\"_\") && key !== \"subscribe\") {\n\t\t\t\tconst ogAction = wrappedActions[key];\n\t\t\t\twrappedActions[key] = new Proxy(ogAction, { apply(target, thisArg, args) {\n\t\t\t\t\tconst isDebugging = shouldDebug2 || storeInfo.debug;\n\t\t\t\t\tif (!(process.env.LOG_LEVEL !== \"0\" && (isDebugging || configureOpts.logLevel !== \"error\"))) return Reflect.apply(target, thisArg, args);\n\t\t\t\t\tsetters = /* @__PURE__ */ new Set();\n\t\t\t\t\tconst curSetters = setters;\n\t\t\t\t\tconst isTopLevelLogger = logStack.size == 0;\n\t\t\t\t\tconst logs = /* @__PURE__ */ new Set();\n\t\t\t\t\tlogStack.add(logs);\n\t\t\t\t\tlet res;\n\t\t\t\t\tconst id = counter++;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tres = Reflect.apply(target, thisArg, args);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(\"Error\", err);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tlogStack.add(\"end\");\n\t\t\t\t\t\tconst name = constr.name;\n\t\t\t\t\t\tconst color = strColor(name);\n\t\t\t\t\t\tconst simpleArgs = args.map(simpleStr);\n\t\t\t\t\t\tlogs.add([\n\t\t\t\t\t\t\t`%c \\u{1F311} ${id} ${name.padStart(isTopLevelLogger ? 8 : 4)}%c.${key}(${simpleArgs.join(\", \")})${isTopLevelLogger && logStack.size > 1 ? ` (+${logStack.size - 1})` : \"\"}`,\n\t\t\t\t\t\t\t`color: ${color};`,\n\t\t\t\t\t\t\t\"color: black;\"\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tif (curSetters.size) curSetters.forEach(({ key: key2, value }) => {\n\t\t\t\t\t\t\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") logs.add([` SET ${key2} ${value}`, value]);\n\t\t\t\t\t\t\telse logs.add([` SET ${key2}`, value]);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (isTopLevelLogger) {\n\t\t\t\t\t\t\tlet error = null;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfor (const item of logStack) {\n\t\t\t\t\t\t\t\t\tif (item === \"end\") {\n\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tconst [head, ...rest] = item;\n\t\t\t\t\t\t\t\t\tif (head) {\n\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(...head);\n\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"...\");\n\t\t\t\t\t\t\t\t\t\tconsole.info(\"args\", args);\n\t\t\t\t\t\t\t\t\t\tconsole.info(\"response\", res);\n\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"trace\");\n\t\t\t\t\t\t\t\t\t\tconsole.trace();\n\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\tfor (const [name2, ...log] of rest) {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(name2);\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(...log);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else console.info(\"Weird log\", head, ...rest);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\terror = err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (const _ of logStack) console.groupEnd();\n\t\t\t\t\t\t\tif (error) console.error(`error loggin`, error);\n\t\t\t\t\t\t\tlogStack.clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t}\n\tconst finishAction = (val) => {\n\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) finishAction\", { didSet });\n\t\tif (didSet) {\n\t\t\tstoreInfo.triggerUpdate();\n\t\t\tdidSet = false;\n\t\t}\n\t\treturn val;\n\t};\n\tlet isTriggering = false;\n\tconst proxiedStore = new Proxy(storeInstance, {\n\t\tget(_, key) {\n\t\t\tif (key in wrappedActions) return wrappedActions[key];\n\t\t\tif (key in passThroughKeys) return Reflect.get(storeInstance, key);\n\t\t\tif (key === UNWRAP_PROXY) return storeInstance;\n\t\t\tif (key === UNWRAP_STORE_INFO) return storeInfo;\n\t\t\tif (storeAccessTrackers.size) storeAccessTrackers.forEach((cb) => cb(storeInfo));\n\t\t\tif (typeof key !== \"string\") return Reflect.get(storeInstance, key);\n\t\t\tif (!storeInfo.disableTracking) {\n\t\t\t\tif (gettersState.isGetting) gettersState.curGetKeys.add(key);\n\t\t\t}\n\t\t\tif (key in getters) {\n\t\t\t\tif (getCache.has(key)) return getCache.get(key);\n\t\t\t\tcurGetKeys.clear();\n\t\t\t\tconst isSubGetter = gettersState.isGetting;\n\t\t\t\tgettersState.isGetting = true;\n\t\t\t\tconst res = getters[key].call(proxiedStore);\n\t\t\t\tif (!isSubGetter) gettersState.isGetting = false;\n\t\t\t\tfor (const gk of curGetKeys) {\n\t\t\t\t\tif (!depsToGetter.has(gk)) depsToGetter.set(gk, /* @__PURE__ */ new Set());\n\t\t\t\t\tdepsToGetter.get(gk).add(key);\n\t\t\t\t}\n\t\t\t\tgetCache.set(key, res);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\treturn Reflect.get(storeInstance, key);\n\t\t},\n\t\tset(target, key, value, receiver) {\n\t\t\tconst cur = Reflect.get(target, key);\n\t\t\tconst res = Reflect.set(target, key, value, receiver);\n\t\t\tif (res && cur !== value) {\n\t\t\t\tif (typeof key === \"string\") {\n\t\t\t\t\tclearGetterCache(key);\n\t\t\t\t\tif (shouldDebug2) {\n\t\t\t\t\t\tsetters.add({\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (getShouldDebug(storeInfo)) console.info(\"(debug) SET\", res, key, value);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"SET...\", {\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (!isTriggering) {\n\t\t\t\t\tisTriggering = true;\n\t\t\t\t\twaitForEventLoop(() => {\n\t\t\t\t\t\tstoreInfo.triggerUpdate();\n\t\t\t\t\t\tisTriggering = false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t});\n\tfunction clearGetterCache(setKey) {\n\t\tconst parentGetters = depsToGetter.get(setKey);\n\t\tgetCache.delete(setKey);\n\t\tif (!parentGetters) return;\n\t\tfor (const gk of parentGetters) {\n\t\t\tgetCache.delete(gk);\n\t\t\tif (depsToGetter.has(gk)) clearGetterCache(gk);\n\t\t}\n\t}\n\treturn proxiedStore;\n}\nconst waitForEventLoop = process.env.NODE_ENV === \"test\" || false ? (cb) => cb() : queueMicrotask;\nlet counter = 0;\nconst passThroughKeys = {\n\tsubscribe: true,\n\t_version: true,\n\t_trackers: true,\n\t$$typeof: true,\n\t_listeners: true,\n\t_enableTracking: true\n};\nfunction getShouldDebug(storeInfo) {\n\tconst info = { storeInstance: storeInfo.store };\n\treturn [...storeInfo.trackers].some((tracker) => tracker.component && shouldDebug(tracker.component, info));\n}\n\nexport { allStores, createStore, createUseStore, createUseStoreSelector, getOrCreateStore, getStore, getStoreInfo, onCreateStore, setIsInReaction, trackStoresAccess, useGlobalStore, useGlobalStoreSelector, useStore, useStoreDebug, useStoreSelector };"],"mappings":";;;;;;;;AAOA,MAAM,QAAQ,MAAM;AACpB,SAAS,SAAS,YAAY,OAAO,UAAU,gBAAgB;CAC9D,OAAO,iBAAiB,qBAAqB,YAAY,OAAO,OAAO,GAAG,QAAQ,UAAU,OAAO;AACpG;AACA,SAAS,cAAc,YAAY,OAAO;CACzC,OAAO,SAAS,YAAY,OAAO,EAAE,OAAO,KAAK,CAAC;AACnD;AACA,SAAS,YAAY,YAAY,OAAO,SAAS;CAChD,OAAO,qBAAqB,YAAY,OAAO,OAAO,GAAG;AAC1D;AACA,SAAS,eAAe,UAAU,OAAO;CACxC,MAAM,QAAQ,SAAS;CACvB,MAAM,MAAM,YAAY,MAAM,aAAa,MAAM,KAAK;CACtD,MAAM,OAAO,MAAM,IAAI,GAAG;CAC1B,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,4CAA4C;CACvE,OAAO,iBAAiB,MAAM,KAAK,GAAG,EAAE,MAAM,CAAC;AAChD;AACA,SAAS,uBAAuB,UAAU,UAAU,OAAO;CAC1D,MAAM,QAAQ,SAAS;CACvB,MAAM,MAAM,YAAY,MAAM,aAAa,MAAM,KAAK;CACtD,MAAM,OAAO,MAAM,IAAI,GAAG;CAC1B,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,4CAA4C;CACvE,OAAO,iBAAiB,MAAM,UAAU,EAAE,MAAM,CAAC;AAClD;AACA,SAAS,eAAe,YAAY;CACnC,QAAQ,OAAO,YAAY,SAAS,YAAY,OAAO,OAAO;AAC/D;AACA,SAAS,uBAAuB,YAAY,UAAU;CACrD,QAAQ,UAAU;EAC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;IACF;IACA,IAAI,CAAC,cAAc;KAClB,eAAe;KACf,uBAAuB;MACtB,UAAU,cAAc;MACxB,eAAe;KAChB,CAAC;IACF;GACD;GACA,OAAO;EACR;CACD,CAAC;CACD,SAAS,iBAAiB,QAAQ;EACjC,MAAM,gBAAgB,aAAa,IAAI,MAAM;EAC7C,SAAS,OAAO,MAAM;EACtB,IAAI,CAAC,eAAe;EACpB,KAAK,MAAM,MAAM,eAAe;GAC/B,SAAS,OAAO,EAAE;GAClB,IAAI,aAAa,IAAI,EAAE,GAAG,iBAAiB,EAAE;EAC9C;CACD;CACA,OAAO;AACR;AACA,MAAM,mBAAmB,QAAQ,IAAI,aAAa,UAAU,SAAS,OAAO,GAAG,IAAI;AACnF,IAAI,UAAU;AACd,MAAM,kBAAkB;CACvB,WAAW;CACX,UAAU;CACV,WAAW;CACX,UAAU;CACV,YAAY;CACZ,iBAAiB;AAClB;AACA,SAAS,eAAe,WAAW;CAClC,MAAM,OAAO,EAAE,eAAe,UAAU,MAAM;CAC9C,OAAO,CAAC,GAAG,UAAU,QAAQ,EAAE,MAAM,YAAY,QAAQ,aAAa,YAAY,QAAQ,WAAW,IAAI,CAAC;AAC3G"}
|
|
1
|
+
{"version":3,"file":"useStore.js","names":[],"sources":["esm/useStore.js"],"sourcesContent":["import React from \"react\";\nimport { isEqualSubsetShallow } from \"./comparators\";\nimport { configureOpts } from \"./configureUseStore\";\nimport { UNWRAP_PROXY, defaultOptions } from \"./constants\";\nimport { UNWRAP_STORE_INFO, cache, getStoreDescriptors, getStoreUid, simpleStr } from \"./helpers\";\nimport { DebugStores, shouldDebug, useCurrentComponent } from \"./useStoreDebug\";\n\nconst idFn = (_) => _;\nfunction useStore(StoreKlass, props, options = defaultOptions) {\n\treturn useStoreFromInfo(getOrCreateStoreInfo(StoreKlass, props, options), options.selector, options);\n}\nfunction useStoreDebug(StoreKlass, props) {\n\treturn useStore(StoreKlass, props, { debug: true });\n}\nfunction createStore(StoreKlass, props, options) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, options)?.store;\n}\nfunction useGlobalStore(instance, debug) {\n\tconst store = instance[UNWRAP_PROXY];\n\tconst uid = getStoreUid(store.constructor, store.props);\n\tconst info = cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, void 0, { debug });\n}\nfunction useGlobalStoreSelector(instance, selector, debug) {\n\tconst store = instance[UNWRAP_PROXY];\n\tconst uid = getStoreUid(store.constructor, store.props);\n\tconst info = cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, selector, { debug });\n}\nfunction createUseStore(StoreKlass) {\n\treturn (props, options) => useStore(StoreKlass, props, options);\n}\nfunction createUseStoreSelector(StoreKlass, selector) {\n\treturn (props) => {\n\t\treturn useStore(StoreKlass, props, { selector });\n\t};\n}\nfunction useStoreSelector(StoreKlass, selector, props) {\n\treturn useStore(StoreKlass, props, { selector });\n}\nconst storeAccessTrackers = /* @__PURE__ */ new Set();\nfunction trackStoresAccess(cb) {\n\tstoreAccessTrackers.add(cb);\n\treturn () => {\n\t\tstoreAccessTrackers.delete(cb);\n\t};\n}\nfunction getStore(StoreKlass, props) {\n\treturn getStoreInfo(StoreKlass, props)?.store;\n}\nfunction getOrCreateStore(StoreKlass, props) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: false })?.store;\n}\nfunction getStoreInfo(StoreKlass, props) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: true });\n}\nconst onCreateListeners = /* @__PURE__ */ new Set();\nfunction onCreateStore(cb) {\n\tonCreateListeners.add(cb);\n\treturn () => {\n\t\tonCreateListeners.delete(cb);\n\t};\n}\nfunction getOrCreateStoreInfo(StoreKlass, props, options, propsKeyCalculated) {\n\tif (!StoreKlass) return null;\n\tconst uid = getStoreUid(StoreKlass, propsKeyCalculated ?? props);\n\tif (!options?.avoidCache && cache.has(uid)) return cache.get(uid);\n\tif (options?.refuseCreation) throw new Error(`No store exists (${StoreKlass.name}) with props: ${props}`);\n\tconst storeInstance = new StoreKlass(props);\n\tstoreInstance.props = props;\n\tconst getters = {};\n\tconst actions = {};\n\tconst stateKeys = /* @__PURE__ */ new Set();\n\tconst descriptors = getStoreDescriptors(storeInstance);\n\tfor (const key in descriptors) {\n\t\tconst descriptor = descriptors[key];\n\t\tif (typeof descriptor.value === \"function\") actions[key] = descriptor.value;\n\t\telse if (typeof descriptor.get === \"function\") getters[key] = descriptor.get;\n\t\telse if (key !== \"props\" && key[0] !== \"_\") stateKeys.add(key);\n\t}\n\tconst keyComparators = storeInstance[\"_comparators\"];\n\tconst listeners = /* @__PURE__ */ new Set();\n\tconst storeInfo = {\n\t\tuid,\n\t\tkeyComparators,\n\t\tstoreInstance,\n\t\tgetters,\n\t\tstateKeys,\n\t\tprops,\n\t\tactions,\n\t\tdebug: options?.debug,\n\t\tdisableTracking: false,\n\t\tgettersState: {\n\t\t\tgetCache: /* @__PURE__ */ new Map(),\n\t\t\tdepsToGetter: /* @__PURE__ */ new Map(),\n\t\t\tcurGetKeys: /* @__PURE__ */ new Set(),\n\t\t\tisGetting: false\n\t\t},\n\t\tlisteners,\n\t\ttrackers: /* @__PURE__ */ new Set(),\n\t\tversion: 0,\n\t\tsubscribe: (onChanged) => {\n\t\t\tlisteners.add(onChanged);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(onChanged);\n\t\t\t};\n\t\t},\n\t\ttriggerUpdate: () => {\n\t\t\tstoreInfo.version = (storeInfo.version + 1) % Number.MAX_SAFE_INTEGER;\n\t\t\tfor (const cb of listeners) cb();\n\t\t}\n\t};\n\tconst store = createProxiedStore(storeInfo);\n\tif (process.env.NODE_ENV === \"development\") allStores[StoreKlass.name + uid] = store;\n\tstore.mount?.();\n\tstoreInfo.store = store;\n\tconst result = storeInfo;\n\tcache.set(uid, result);\n\tonCreateListeners.forEach((cb) => cb(result));\n\treturn result;\n}\nconst allStores = {};\nif (process.env.NODE_ENV === \"development\") globalThis[\"Store\"] ||= allStores;\nconst emptyObj = {};\nconst selectKeys = (obj, keys) => {\n\tif (!keys.length) return emptyObj;\n\tconst res = {};\n\tfor (const key of keys) res[key] = obj[key];\n\treturn res;\n};\nlet isInReaction = false;\nconst setIsInReaction = (val) => {\n\tisInReaction = val;\n};\nfunction useStoreFromInfo(info, userSelector, options) {\n\tconst store = info?.store;\n\tconst internal = React.useRef(void 0);\n\tconst component = useCurrentComponent();\n\tif (!internal.current) internal.current = {\n\t\tcomponent,\n\t\ttracked: /* @__PURE__ */ new Set(),\n\t\tlast: null,\n\t\tlastKeys: null\n\t};\n\tconst curInternal = internal.current;\n\tconst shouldPrintDebug = options?.debug;\n\tconst getSnapshot = React.useCallback(() => {\n\t\tif (!info || !store) return;\n\t\tconst curInternal2 = internal.current;\n\t\tconst isTracking = curInternal2.tracked.size;\n\t\tconst keys = [...!isTracking ? info.stateKeys : curInternal2.tracked];\n\t\tconst nextKeys = `${info.version}${keys.join(\"\")}${userSelector || \"\"}`;\n\t\tconst lastKeys = curInternal2.lastKeys;\n\t\tif (nextKeys === curInternal2.lastKeys) return curInternal2.last;\n\t\tcurInternal2.lastKeys = nextKeys;\n\t\tlet snap;\n\t\tinfo.disableTracking = true;\n\t\tconst last = curInternal2.last;\n\t\tif (userSelector) snap = userSelector(store);\n\t\telse snap = selectKeys(store, keys);\n\t\tinfo.disableTracking = false;\n\t\tconst isUnchanged = !userSelector && !isTracking && last || typeof last !== \"undefined\" && isEqualSubsetShallow(last, snap, { keyComparators: info.keyComparators });\n\t\tif (shouldPrintDebug) console.info(\"🌑 getSnapshot\", {\n\t\t\tstoreState: selectKeys(store, Object.keys(store)),\n\t\t\tuserSelector,\n\t\t\tinfo,\n\t\t\tisUnchanged,\n\t\t\tcomponent,\n\t\t\tkeys,\n\t\t\tlast,\n\t\t\tsnap,\n\t\t\tcurInternal: curInternal2,\n\t\t\tnextKeys,\n\t\t\tlastKeys\n\t\t});\n\t\tif (isUnchanged) return last;\n\t\tcurInternal2.last = snap;\n\t\treturn snap;\n\t}, [store]);\n\tconst state = React.useSyncExternalStore(info?.subscribe || idFn, getSnapshot, getSnapshot);\n\tif (!info || !store || !state) return state;\n\tif (userSelector) return state;\n\treturn new Proxy(store, { get(target, key) {\n\t\tconst curVal = Reflect.get(target, key);\n\t\tif (isInReaction) return curVal;\n\t\tconst keyString = key;\n\t\tif (info.stateKeys.has(keyString) || keyString in info.getters) {\n\t\t\tif (shouldPrintDebug) console.info(\"👀 tracking\", keyString);\n\t\t\tcurInternal.tracked.add(keyString);\n\t\t}\n\t\tif (Reflect.has(state, key)) return Reflect.get(state, key);\n\t\treturn curVal;\n\t} });\n}\nlet setters = /* @__PURE__ */ new Set();\nconst logStack = /* @__PURE__ */ new Set();\nfunction createProxiedStore(storeInfo) {\n\tconst { actions, storeInstance, getters, gettersState } = storeInfo;\n\tconst { getCache, curGetKeys, depsToGetter } = gettersState;\n\tconst constr = storeInstance.constructor;\n\tconst shouldDebug2 = storeInfo.debug ?? DebugStores.has(constr);\n\tlet didSet = false;\n\tconst wrappedActions = {};\n\tfor (const key in actions) {\n\t\tif (key === \"subscribe\") continue;\n\t\tconst actionFn = actions[key];\n\t\tconst isGetFn = key.startsWith(\"get\");\n\t\twrappedActions[key] = function useStoreAction(...args) {\n\t\t\tlet res;\n\t\t\tif (isGetFn || gettersState.isGetting) return Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) startAction\", key);\n\t\t\tres = Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (res instanceof Promise) return res.then(finishAction);\n\t\t\tfinishAction();\n\t\t\treturn res;\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\tlet hashCode = function(str) {\n\t\t\t\tlet hash = 0;\n\t\t\t\tfor (let i = 0; i < str.length; i++) hash = str.charCodeAt(i) + ((hash << 5) - hash);\n\t\t\t\treturn hash;\n\t\t\t}, strColor = function(str) {\n\t\t\t\treturn `hsl(${hashCode(str) % 360}, 90%, 40%)`;\n\t\t\t};\n\t\t\tif (!key.startsWith(\"get\") && !key.startsWith(\"_\") && key !== \"subscribe\") {\n\t\t\t\tconst ogAction = wrappedActions[key];\n\t\t\t\twrappedActions[key] = new Proxy(ogAction, { apply(target, thisArg, args) {\n\t\t\t\t\tconst isDebugging = shouldDebug2 || storeInfo.debug;\n\t\t\t\t\tif (!(process.env.LOG_LEVEL !== \"0\" && (isDebugging || configureOpts.logLevel !== \"error\"))) return Reflect.apply(target, thisArg, args);\n\t\t\t\t\tsetters = /* @__PURE__ */ new Set();\n\t\t\t\t\tconst curSetters = setters;\n\t\t\t\t\tconst isTopLevelLogger = logStack.size == 0;\n\t\t\t\t\tconst logs = /* @__PURE__ */ new Set();\n\t\t\t\t\tlogStack.add(logs);\n\t\t\t\t\tlet res;\n\t\t\t\t\tconst id = counter++;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tres = Reflect.apply(target, thisArg, args);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(\"Error\", err);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tlogStack.add(\"end\");\n\t\t\t\t\t\tconst name = constr.name;\n\t\t\t\t\t\tconst color = strColor(name);\n\t\t\t\t\t\tconst simpleArgs = args.map(simpleStr);\n\t\t\t\t\t\tlogs.add([\n\t\t\t\t\t\t\t`%c \\u{1F311} ${id} ${name.padStart(isTopLevelLogger ? 8 : 4)}%c.${key}(${simpleArgs.join(\", \")})${isTopLevelLogger && logStack.size > 1 ? ` (+${logStack.size - 1})` : \"\"}`,\n\t\t\t\t\t\t\t`color: ${color};`,\n\t\t\t\t\t\t\t\"color: black;\"\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tif (curSetters.size) curSetters.forEach(({ key: key2, value }) => {\n\t\t\t\t\t\t\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") logs.add([` SET ${key2} ${value}`, value]);\n\t\t\t\t\t\t\telse logs.add([` SET ${key2}`, value]);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (isTopLevelLogger) {\n\t\t\t\t\t\t\tlet error = null;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfor (const item of logStack) {\n\t\t\t\t\t\t\t\t\tif (item === \"end\") {\n\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tconst [head, ...rest] = item;\n\t\t\t\t\t\t\t\t\tif (head) {\n\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(...head);\n\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"...\");\n\t\t\t\t\t\t\t\t\t\tconsole.info(\"args\", args);\n\t\t\t\t\t\t\t\t\t\tconsole.info(\"response\", res);\n\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"trace\");\n\t\t\t\t\t\t\t\t\t\tconsole.trace();\n\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\tfor (const [name2, ...log] of rest) {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(name2);\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(...log);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else console.info(\"Weird log\", head, ...rest);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\terror = err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (const _ of logStack) console.groupEnd();\n\t\t\t\t\t\t\tif (error) console.error(`error loggin`, error);\n\t\t\t\t\t\t\tlogStack.clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t}\n\tconst finishAction = (val) => {\n\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) finishAction\", { didSet });\n\t\tif (didSet) {\n\t\t\tstoreInfo.triggerUpdate();\n\t\t\tdidSet = false;\n\t\t}\n\t\treturn val;\n\t};\n\tlet isTriggering = false;\n\tconst proxiedStore = new Proxy(storeInstance, {\n\t\tget(_, key) {\n\t\t\tif (key in wrappedActions) return wrappedActions[key];\n\t\t\tif (key in passThroughKeys) return Reflect.get(storeInstance, key);\n\t\t\tif (key === UNWRAP_PROXY) return storeInstance;\n\t\t\tif (key === UNWRAP_STORE_INFO) return storeInfo;\n\t\t\tif (storeAccessTrackers.size) storeAccessTrackers.forEach((cb) => cb(storeInfo));\n\t\t\tif (typeof key !== \"string\") return Reflect.get(storeInstance, key);\n\t\t\tif (!storeInfo.disableTracking) {\n\t\t\t\tif (gettersState.isGetting) gettersState.curGetKeys.add(key);\n\t\t\t}\n\t\t\tif (key in getters) {\n\t\t\t\tif (getCache.has(key)) return getCache.get(key);\n\t\t\t\tcurGetKeys.clear();\n\t\t\t\tconst isSubGetter = gettersState.isGetting;\n\t\t\t\tgettersState.isGetting = true;\n\t\t\t\tconst res = getters[key].call(proxiedStore);\n\t\t\t\tif (!isSubGetter) gettersState.isGetting = false;\n\t\t\t\tfor (const gk of curGetKeys) {\n\t\t\t\t\tif (!depsToGetter.has(gk)) depsToGetter.set(gk, /* @__PURE__ */ new Set());\n\t\t\t\t\tdepsToGetter.get(gk).add(key);\n\t\t\t\t}\n\t\t\t\tgetCache.set(key, res);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\treturn Reflect.get(storeInstance, key);\n\t\t},\n\t\tset(target, key, value, receiver) {\n\t\t\tconst cur = Reflect.get(target, key);\n\t\t\tconst res = Reflect.set(target, key, value, receiver);\n\t\t\tif (res && cur !== value) {\n\t\t\t\tif (typeof key === \"string\") {\n\t\t\t\t\tclearGetterCache(key);\n\t\t\t\t\tif (shouldDebug2) {\n\t\t\t\t\t\tsetters.add({\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (getShouldDebug(storeInfo)) console.info(\"(debug) SET\", res, key, value);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"SET...\", {\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (!isTriggering) {\n\t\t\t\t\tisTriggering = true;\n\t\t\t\t\twaitForEventLoop(() => {\n\t\t\t\t\t\tstoreInfo.triggerUpdate();\n\t\t\t\t\t\tisTriggering = false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t});\n\tfunction clearGetterCache(setKey) {\n\t\tconst parentGetters = depsToGetter.get(setKey);\n\t\tgetCache.delete(setKey);\n\t\tif (!parentGetters) return;\n\t\tfor (const gk of parentGetters) {\n\t\t\tgetCache.delete(gk);\n\t\t\tif (depsToGetter.has(gk)) clearGetterCache(gk);\n\t\t}\n\t}\n\treturn proxiedStore;\n}\nconst waitForEventLoop = process.env.NODE_ENV === \"test\" || false ? (cb) => cb() : queueMicrotask;\nlet counter = 0;\nconst passThroughKeys = {\n\tsubscribe: true,\n\t_version: true,\n\t_trackers: true,\n\t$$typeof: true,\n\t_listeners: true,\n\t_enableTracking: true\n};\nfunction getShouldDebug(storeInfo) {\n\tconst info = { storeInstance: storeInfo.store };\n\treturn [...storeInfo.trackers].some((tracker) => tracker.component && shouldDebug(tracker.component, info));\n}\n\nexport { allStores, createStore, createUseStore, createUseStoreSelector, getOrCreateStore, getStore, getStoreInfo, onCreateStore, setIsInReaction, trackStoresAccess, useGlobalStore, useGlobalStoreSelector, useStore, useStoreDebug, useStoreSelector };"],"mappings":";;;;;;;;AAOA,MAAM,QAAQ,MAAM;AACpB,SAAS,SAAS,Y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/B,SAAS,OAAO,EAAE;GAClB,IAAI,aAAa,IAAI,EAAE,GAAG,iBAAiB,EAAE;EAC9C;CACD;CACA,OAAO;AACR;AACA,MAAM,mBAAmB,QAAQ,IAAI,aAAa,UAAU,SAAS,OAAO,GAAG,IAAI;AACnF,IAAI,UAAU;AACd,MAAM,kBAAkB;CACvB,WAAW;CACX,UAAU;CACV,WAAW;CACX,UAAU;CACV,YAAY;CACZ,iBAAiB;AAClB;AACA,SAAS,eAAe,WAAW;CAClC,MAAM,OAAO,EAAE,eAAe,UAAU,MAAM;CAC9C,OAAO,CAAC,GAAG,UAAU,QAAQ,CAAC,CAAC,MAAM,YAAY,QAAQ,aAAa,YAAY,QAAQ,WAAW,IAAI,CAAC;AAC3G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStore.native.js","names":[],"sources":["esm/useStore.native.js"],"sourcesContent":["import React from \"react\";\nimport { isEqualSubsetShallow } from \"./comparators\";\nimport { configureOpts } from \"./configureUseStore\";\nimport { UNWRAP_PROXY, defaultOptions } from \"./constants\";\nimport { UNWRAP_STORE_INFO, cache, getStoreDescriptors, getStoreUid, simpleStr } from \"./helpers\";\nimport { DebugStores, shouldDebug, useCurrentComponent } from \"./useStoreDebug\";\n\nfunction _instanceof(left, right) {\n\tif (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);\n\telse return left instanceof right;\n}\nvar idFn = function(_) {\n\treturn _;\n};\nfunction useStore(StoreKlass, props) {\n\tvar options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : defaultOptions;\n\treturn useStoreFromInfo(getOrCreateStoreInfo(StoreKlass, props, options), options.selector, options);\n}\nfunction useStoreDebug(StoreKlass, props) {\n\treturn useStore(StoreKlass, props, { debug: true });\n}\nfunction createStore(StoreKlass, props, options) {\n\tvar _getOrCreateStoreInfo;\n\treturn (_getOrCreateStoreInfo = getOrCreateStoreInfo(StoreKlass, props, options)) === null || _getOrCreateStoreInfo === void 0 ? void 0 : _getOrCreateStoreInfo.store;\n}\nfunction useGlobalStore(instance, debug) {\n\tvar store = instance[UNWRAP_PROXY];\n\tvar uid = getStoreUid(store.constructor, store.props);\n\tvar info = cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, void 0, { debug });\n}\nfunction useGlobalStoreSelector(instance, selector, debug) {\n\tvar store = instance[UNWRAP_PROXY];\n\tvar uid = getStoreUid(store.constructor, store.props);\n\tvar info = cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, selector, { debug });\n}\nfunction createUseStore(StoreKlass) {\n\treturn function(props, options) {\n\t\treturn useStore(StoreKlass, props, options);\n\t};\n}\nfunction createUseStoreSelector(StoreKlass, selector) {\n\treturn function(props) {\n\t\treturn useStore(StoreKlass, props, { selector });\n\t};\n}\nfunction useStoreSelector(StoreKlass, selector, props) {\n\treturn useStore(StoreKlass, props, { selector });\n}\nvar storeAccessTrackers = /* @__PURE__ */ new Set();\nfunction trackStoresAccess(cb) {\n\tstoreAccessTrackers.add(cb);\n\treturn function() {\n\t\tstoreAccessTrackers.delete(cb);\n\t};\n}\nfunction getStore(StoreKlass, props) {\n\tvar _getStoreInfo;\n\treturn (_getStoreInfo = getStoreInfo(StoreKlass, props)) === null || _getStoreInfo === void 0 ? void 0 : _getStoreInfo.store;\n}\nfunction getOrCreateStore(StoreKlass, props) {\n\tvar _getOrCreateStoreInfo;\n\treturn (_getOrCreateStoreInfo = getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: false })) === null || _getOrCreateStoreInfo === void 0 ? void 0 : _getOrCreateStoreInfo.store;\n}\nfunction getStoreInfo(StoreKlass, props) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: true });\n}\nvar onCreateListeners = /* @__PURE__ */ new Set();\nfunction onCreateStore(cb) {\n\tonCreateListeners.add(cb);\n\treturn function() {\n\t\tonCreateListeners.delete(cb);\n\t};\n}\nfunction getOrCreateStoreInfo(StoreKlass, props, options, propsKeyCalculated) {\n\tvar _store_mount;\n\tif (!StoreKlass) return null;\n\tvar uid = getStoreUid(StoreKlass, propsKeyCalculated !== null && propsKeyCalculated !== void 0 ? propsKeyCalculated : props);\n\tif (!(options === null || options === void 0 ? void 0 : options.avoidCache) && cache.has(uid)) return cache.get(uid);\n\tif (options === null || options === void 0 ? void 0 : options.refuseCreation) throw new Error(`No store exists (${StoreKlass.name}) with props: ${props}`);\n\tvar storeInstance = new StoreKlass(props);\n\tstoreInstance.props = props;\n\tvar getters = {};\n\tvar actions = {};\n\tvar stateKeys = /* @__PURE__ */ new Set();\n\tvar descriptors = getStoreDescriptors(storeInstance);\n\tfor (var key in descriptors) {\n\t\tvar descriptor = descriptors[key];\n\t\tif (typeof descriptor.value === \"function\") actions[key] = descriptor.value;\n\t\telse if (typeof descriptor.get === \"function\") getters[key] = descriptor.get;\n\t\telse if (key !== \"props\" && key[0] !== \"_\") stateKeys.add(key);\n\t}\n\tvar keyComparators = storeInstance[\"_comparators\"];\n\tvar listeners = /* @__PURE__ */ new Set();\n\tvar storeInfo = {\n\t\tuid,\n\t\tkeyComparators,\n\t\tstoreInstance,\n\t\tgetters,\n\t\tstateKeys,\n\t\tprops,\n\t\tactions,\n\t\tdebug: options === null || options === void 0 ? void 0 : options.debug,\n\t\tdisableTracking: false,\n\t\tgettersState: {\n\t\t\tgetCache: /* @__PURE__ */ new Map(),\n\t\t\tdepsToGetter: /* @__PURE__ */ new Map(),\n\t\t\tcurGetKeys: /* @__PURE__ */ new Set(),\n\t\t\tisGetting: false\n\t\t},\n\t\tlisteners,\n\t\ttrackers: /* @__PURE__ */ new Set(),\n\t\tversion: 0,\n\t\tsubscribe: function(onChanged) {\n\t\t\tlisteners.add(onChanged);\n\t\t\treturn function() {\n\t\t\t\tlisteners.delete(onChanged);\n\t\t\t};\n\t\t},\n\t\ttriggerUpdate: function() {\n\t\t\tstoreInfo.version = (storeInfo.version + 1) % Number.MAX_SAFE_INTEGER;\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar cb = _step.value;\n\t\t\t\t\tcb();\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\tvar store = createProxiedStore(storeInfo);\n\tif (process.env.NODE_ENV === \"development\") allStores[StoreKlass.name + uid] = store;\n\t(_store_mount = store.mount) === null || _store_mount === void 0 || _store_mount.call(store);\n\tstoreInfo.store = store;\n\tvar result = storeInfo;\n\tcache.set(uid, result);\n\tonCreateListeners.forEach(function(cb) {\n\t\treturn cb(result);\n\t});\n\treturn result;\n}\nvar allStores = {};\nif (process.env.NODE_ENV === \"development\") {\n\tvar _globalThis, _Store;\n\t(_globalThis = globalThis)[_Store = \"Store\"] || (_globalThis[_Store] = allStores);\n}\nvar emptyObj = {};\nvar selectKeys = function(obj, keys) {\n\tif (!keys.length) return emptyObj;\n\tvar res = {};\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar key = _step.value;\n\t\t\tres[key] = obj[key];\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn res;\n};\nvar isInReaction = false;\nvar setIsInReaction = function(val) {\n\tisInReaction = val;\n};\nfunction useStoreFromInfo(info, userSelector, options) {\n\tvar store = info === null || info === void 0 ? void 0 : info.store;\n\tvar internal = React.useRef(void 0);\n\tvar component = useCurrentComponent();\n\tif (!internal.current) internal.current = {\n\t\tcomponent,\n\t\ttracked: /* @__PURE__ */ new Set(),\n\t\tlast: null,\n\t\tlastKeys: null\n\t};\n\tvar curInternal = internal.current;\n\tvar shouldPrintDebug = options === null || options === void 0 ? void 0 : options.debug;\n\tvar getSnapshot = React.useCallback(function() {\n\t\tif (!info || !store) return;\n\t\tvar curInternal2 = internal.current;\n\t\tvar isTracking = curInternal2.tracked.size;\n\t\tvar keys = [...!isTracking ? info.stateKeys : curInternal2.tracked];\n\t\tvar nextKeys = `${info.version}${keys.join(\"\")}${userSelector || \"\"}`;\n\t\tvar lastKeys = curInternal2.lastKeys;\n\t\tif (nextKeys === curInternal2.lastKeys) return curInternal2.last;\n\t\tcurInternal2.lastKeys = nextKeys;\n\t\tvar snap;\n\t\tinfo.disableTracking = true;\n\t\tvar last = curInternal2.last;\n\t\tif (userSelector) snap = userSelector(store);\n\t\telse snap = selectKeys(store, keys);\n\t\tinfo.disableTracking = false;\n\t\tvar isUnchanged = !userSelector && !isTracking && last || typeof last !== \"undefined\" && isEqualSubsetShallow(last, snap, { keyComparators: info.keyComparators });\n\t\tif (shouldPrintDebug) console.info(\"🌑 getSnapshot\", {\n\t\t\tstoreState: selectKeys(store, Object.keys(store)),\n\t\t\tuserSelector,\n\t\t\tinfo,\n\t\t\tisUnchanged,\n\t\t\tcomponent,\n\t\t\tkeys,\n\t\t\tlast,\n\t\t\tsnap,\n\t\t\tcurInternal: curInternal2,\n\t\t\tnextKeys,\n\t\t\tlastKeys\n\t\t});\n\t\tif (isUnchanged) return last;\n\t\tcurInternal2.last = snap;\n\t\treturn snap;\n\t}, [store]);\n\tvar state = React.useSyncExternalStore((info === null || info === void 0 ? void 0 : info.subscribe) || idFn, getSnapshot, getSnapshot);\n\tif (!info || !store || !state) return state;\n\tif (userSelector) return state;\n\treturn new Proxy(store, { get(target, key) {\n\t\tvar curVal = Reflect.get(target, key);\n\t\tif (isInReaction) return curVal;\n\t\tvar keyString = key;\n\t\tif (info.stateKeys.has(keyString) || keyString in info.getters) {\n\t\t\tif (shouldPrintDebug) console.info(\"👀 tracking\", keyString);\n\t\t\tcurInternal.tracked.add(keyString);\n\t\t}\n\t\tif (Reflect.has(state, key)) return Reflect.get(state, key);\n\t\treturn curVal;\n\t} });\n}\nvar setters = /* @__PURE__ */ new Set();\nvar logStack = /* @__PURE__ */ new Set();\nfunction createProxiedStore(storeInfo) {\n\tvar _loop = function(key2) {\n\t\tif (key2 === \"subscribe\") return \"continue\";\n\t\tvar actionFn = actions[key2];\n\t\tvar isGetFn = key2.startsWith(\"get\");\n\t\twrappedActions[key2] = function useStoreAction() {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\t\t\tvar res;\n\t\t\tif (isGetFn || gettersState.isGetting) return Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) startAction\", key2);\n\t\t\tres = Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (_instanceof(res, Promise)) return res.then(finishAction);\n\t\t\tfinishAction();\n\t\t\treturn res;\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\tlet hashCode2 = function(str) {\n\t\t\t\tvar hash = 0;\n\t\t\t\tfor (var i = 0; i < str.length; i++) hash = str.charCodeAt(i) + ((hash << 5) - hash);\n\t\t\t\treturn hash;\n\t\t\t}, strColor2 = function(str) {\n\t\t\t\treturn `hsl(${hashCode2(str) % 360}, 90%, 40%)`;\n\t\t\t};\n\t\t\tif (!key2.startsWith(\"get\") && !key2.startsWith(\"_\") && key2 !== \"subscribe\") {\n\t\t\t\tvar ogAction = wrappedActions[key2];\n\t\t\t\twrappedActions[key2] = new Proxy(ogAction, { apply(target, thisArg, args) {\n\t\t\t\t\tvar isDebugging = shouldDebug2 || storeInfo.debug;\n\t\t\t\t\tif (!(process.env.LOG_LEVEL !== \"0\" && (isDebugging || configureOpts.logLevel !== \"error\"))) return Reflect.apply(target, thisArg, args);\n\t\t\t\t\tsetters = /* @__PURE__ */ new Set();\n\t\t\t\t\tvar curSetters = setters;\n\t\t\t\t\tvar isTopLevelLogger = logStack.size == 0;\n\t\t\t\t\tvar logs = /* @__PURE__ */ new Set();\n\t\t\t\t\tlogStack.add(logs);\n\t\t\t\t\tvar res;\n\t\t\t\t\tvar id = counter++;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tres = Reflect.apply(target, thisArg, args);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(\"Error\", err);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tlogStack.add(\"end\");\n\t\t\t\t\t\tvar name = constr.name;\n\t\t\t\t\t\tvar color = strColor2(name);\n\t\t\t\t\t\tvar simpleArgs = args.map(simpleStr);\n\t\t\t\t\t\tlogs.add([\n\t\t\t\t\t\t\t`%c \\u{1F311} ${id} ${name.padStart(isTopLevelLogger ? 8 : 4)}%c.${key2}(${simpleArgs.join(\", \")})${isTopLevelLogger && logStack.size > 1 ? ` (+${logStack.size - 1})` : \"\"}`,\n\t\t\t\t\t\t\t`color: ${color};`,\n\t\t\t\t\t\t\t\"color: black;\"\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tif (curSetters.size) curSetters.forEach(function(param) {\n\t\t\t\t\t\t\tvar { key: key3, value } = param;\n\t\t\t\t\t\t\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") logs.add([` SET ${key3} ${value}`, value]);\n\t\t\t\t\t\t\telse logs.add([` SET ${key3}`, value]);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (isTopLevelLogger) {\n\t\t\t\t\t\t\tvar error = null;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tfor (var _iterator = logStack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\t\t\t\t\t\tvar item = _step.value;\n\t\t\t\t\t\t\t\t\t\tif (item === \"end\") {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvar [head, ...rest] = item;\n\t\t\t\t\t\t\t\t\t\tif (head) {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(...head);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"...\");\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(\"args\", args);\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(\"response\", res);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"trace\");\n\t\t\t\t\t\t\t\t\t\t\tconsole.trace();\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var _iterator1 = rest[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar [name1, ...log] = _step1.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(name1);\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.info(...log);\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t\t\t\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else console.info(\"Weird log\", head, ...rest);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t\t\t\t\t_iteratorError = err;\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\terror = err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfor (var _iterator2 = logStack[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\t\t\t\t\t\t_step2.value;\n\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t_didIteratorError2 = true;\n\t\t\t\t\t\t\t\t_iteratorError2 = err;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (error) console.error(`error loggin`, error);\n\t\t\t\t\t\t\tlogStack.clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t};\n\tvar { actions, storeInstance, getters, gettersState } = storeInfo;\n\tvar { getCache, curGetKeys, depsToGetter } = gettersState;\n\tvar constr = storeInstance.constructor;\n\tvar _storeInfo_debug;\n\tvar shouldDebug2 = (_storeInfo_debug = storeInfo.debug) !== null && _storeInfo_debug !== void 0 ? _storeInfo_debug : DebugStores.has(constr);\n\tvar didSet = false;\n\tvar wrappedActions = {};\n\tfor (var key in actions) _loop(key);\n\tvar finishAction = function(val) {\n\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) finishAction\", { didSet });\n\t\tif (didSet) {\n\t\t\tstoreInfo.triggerUpdate();\n\t\t\tdidSet = false;\n\t\t}\n\t\treturn val;\n\t};\n\tvar isTriggering = false;\n\tvar proxiedStore = new Proxy(storeInstance, {\n\t\tget(_, key2) {\n\t\t\tif (key2 in wrappedActions) return wrappedActions[key2];\n\t\t\tif (key2 in passThroughKeys) return Reflect.get(storeInstance, key2);\n\t\t\tif (key2 === UNWRAP_PROXY) return storeInstance;\n\t\t\tif (key2 === UNWRAP_STORE_INFO) return storeInfo;\n\t\t\tif (storeAccessTrackers.size) storeAccessTrackers.forEach(function(cb) {\n\t\t\t\treturn cb(storeInfo);\n\t\t\t});\n\t\t\tif (typeof key2 !== \"string\") return Reflect.get(storeInstance, key2);\n\t\t\tif (!storeInfo.disableTracking) {\n\t\t\t\tif (gettersState.isGetting) gettersState.curGetKeys.add(key2);\n\t\t\t}\n\t\t\tif (key2 in getters) {\n\t\t\t\tif (getCache.has(key2)) return getCache.get(key2);\n\t\t\t\tcurGetKeys.clear();\n\t\t\t\tvar isSubGetter = gettersState.isGetting;\n\t\t\t\tgettersState.isGetting = true;\n\t\t\t\tvar res = getters[key2].call(proxiedStore);\n\t\t\t\tif (!isSubGetter) gettersState.isGetting = false;\n\t\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator = curGetKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\t\tvar gk = _step.value;\n\t\t\t\t\t\tif (!depsToGetter.has(gk)) depsToGetter.set(gk, /* @__PURE__ */ new Set());\n\t\t\t\t\t\tdepsToGetter.get(gk).add(key2);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t_iteratorError = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgetCache.set(key2, res);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\treturn Reflect.get(storeInstance, key2);\n\t\t},\n\t\tset(target, key2, value, receiver) {\n\t\t\tvar cur = Reflect.get(target, key2);\n\t\t\tvar res = Reflect.set(target, key2, value, receiver);\n\t\t\tif (res && cur !== value) {\n\t\t\t\tif (typeof key2 === \"string\") {\n\t\t\t\t\tclearGetterCache(key2);\n\t\t\t\t\tif (shouldDebug2) {\n\t\t\t\t\t\tsetters.add({\n\t\t\t\t\t\t\tkey: key2,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (getShouldDebug(storeInfo)) console.info(\"(debug) SET\", res, key2, value);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"SET...\", {\n\t\t\t\t\t\tkey: key2,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (!isTriggering) {\n\t\t\t\t\tisTriggering = true;\n\t\t\t\t\twaitForEventLoop(function() {\n\t\t\t\t\t\tstoreInfo.triggerUpdate();\n\t\t\t\t\t\tisTriggering = false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t});\n\tfunction clearGetterCache(setKey) {\n\t\tvar parentGetters = depsToGetter.get(setKey);\n\t\tgetCache.delete(setKey);\n\t\tif (!parentGetters) return;\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = parentGetters[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar gk = _step.value;\n\t\t\t\tgetCache.delete(gk);\n\t\t\t\tif (depsToGetter.has(gk)) clearGetterCache(gk);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\treturn proxiedStore;\n}\nvar waitForEventLoop = (process.env.NODE_ENV, function(cb) {\n\treturn cb();\n});\nvar counter = 0;\nvar passThroughKeys = {\n\tsubscribe: true,\n\t_version: true,\n\t_trackers: true,\n\t$$typeof: true,\n\t_listeners: true,\n\t_enableTracking: true\n};\nfunction getShouldDebug(storeInfo) {\n\tvar info = { storeInstance: storeInfo.store };\n\treturn [...storeInfo.trackers].some(function(tracker) {\n\t\treturn tracker.component && shouldDebug(tracker.component, info);\n\t});\n}\n\nexport { allStores, createStore, createUseStore, createUseStoreSelector, getOrCreateStore, getStore, getStoreInfo, onCreateStore, setIsInReaction, trackStoresAccess, useGlobalStore, useGlobalStoreSelector, useStore, useStoreDebug, useStoreSelector };"],"mappings":";;;;;;;;AAOA,SAAS,YAAY,MAAM,OAAO;CACjC,IAAI,SAAS,QAAQ,OAAO,WAAW,eAAe,MAAM,OAAO,cAAc,OAAO,CAAC,CAAC,MAAM,OAAO,aAAa,IAAI;MACnH,OAAO,gBAAgB;AAC7B;AACA,IAAI,OAAO,SAAS,GAAG;CACtB,OAAO;AACR;AACA,SAAS,SAAS,YAAY,OAAO;CACpC,IAAI,UAAU,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC/E,OAAO,iBAAiB,qBAAqB,YAAY,OAAO,OAAO,GAAG,QAAQ,UAAU,OAAO;AACpG;AACA,SAAS,cAAc,YAAY,OAAO;CACzC,OAAO,SAAS,YAAY,OAAO,EAAE,OAAO,KAAK,CAAC;AACnD;AACA,SAAS,YAAY,YAAY,OAAO,SAAS;CAChD,IAAI;CACJ,QAAQ,wBAAwB,qBAAqB,YAAY,OAAO,OAAO,OAAO,QAAQ,0BAA0B,KAAK,IAAI,KAAK,IAAI,sBAAsB;AACjK;AACA,SAAS,eAAe,UAAU,OAAO;CACxC,IAAI,QAAQ,SAAS;CACrB,IAAI,MAAM,YAAY,MAAM,aAAa,MAAM,KAAK;CACpD,IAAI,OAA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;CACD,CAAC;CACD,SAAS,iBAAiB,QAAQ;EACjC,IAAI,gBAAgB,aAAa,IAAI,MAAM;EAC3C,SAAS,OAAO,MAAM;EACtB,IAAI,CAAC,eAAe;EACpB,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACH,KAAK,IAAI,YAAY,cAAc,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;IAC/J,IAAI,KAAK,MAAM;IACf,SAAS,OAAO,EAAE;IAClB,IAAI,aAAa,IAAI,EAAE,GAAG,iBAAiB,EAAE;GAC9C;EACD,SAAS,KAAK;GACb,oBAAoB;GACpB,iBAAiB;EAClB,UAAU;GACT,IAAI;IACH,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM,UAAU,OAAO;GAC9E,UAAU;IACT,IAAI,mBAAmB,MAAM;GAC9B;EACD;CACD;CACA,OAAO;AACR;AACA,IAAI,oBAAoB,QAAQ,IAAI,UAAU,SAAS,IAAI;CAC1D,OAAO,GAAG;AACX;AACA,IAAI,UAAU;AACd,IAAI,kBAAkB;CACrB,WAAW;CACX,UAAU;CACV,WAAW;CACX,UAAU;CACV,YAAY;CACZ,iBAAiB;AAClB;AACA,SAAS,eAAe,WAAW;CAClC,IAAI,OAAO,EAAE,eAAe,UAAU,MAAM;CAC5C,OAAO,CAAC,GAAG,UAAU,QAAQ,EAAE,KAAK,SAAS,SAAS;EACrD,OAAO,QAAQ,aAAa,YAAY,QAAQ,WAAW,IAAI;CAChE,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"useStore.native.js","names":[],"sources":["esm/useStore.native.js"],"sourcesContent":["import React from \"react\";\nimport { isEqualSubsetShallow } from \"./comparators\";\nimport { configureOpts } from \"./configureUseStore\";\nimport { UNWRAP_PROXY, defaultOptions } from \"./constants\";\nimport { UNWRAP_STORE_INFO, cache, getStoreDescriptors, getStoreUid, simpleStr } from \"./helpers\";\nimport { DebugStores, shouldDebug, useCurrentComponent } from \"./useStoreDebug\";\n\nfunction _instanceof(left, right) {\n\tif (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) return !!right[Symbol.hasInstance](left);\n\telse return left instanceof right;\n}\nvar idFn = function(_) {\n\treturn _;\n};\nfunction useStore(StoreKlass, props) {\n\tvar options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : defaultOptions;\n\treturn useStoreFromInfo(getOrCreateStoreInfo(StoreKlass, props, options), options.selector, options);\n}\nfunction useStoreDebug(StoreKlass, props) {\n\treturn useStore(StoreKlass, props, { debug: true });\n}\nfunction createStore(StoreKlass, props, options) {\n\tvar _getOrCreateStoreInfo;\n\treturn (_getOrCreateStoreInfo = getOrCreateStoreInfo(StoreKlass, props, options)) === null || _getOrCreateStoreInfo === void 0 ? void 0 : _getOrCreateStoreInfo.store;\n}\nfunction useGlobalStore(instance, debug) {\n\tvar store = instance[UNWRAP_PROXY];\n\tvar uid = getStoreUid(store.constructor, store.props);\n\tvar info = cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, void 0, { debug });\n}\nfunction useGlobalStoreSelector(instance, selector, debug) {\n\tvar store = instance[UNWRAP_PROXY];\n\tvar uid = getStoreUid(store.constructor, store.props);\n\tvar info = cache.get(uid);\n\tif (!info) throw new Error(`This store not created using createStore()`);\n\treturn useStoreFromInfo(info, selector, { debug });\n}\nfunction createUseStore(StoreKlass) {\n\treturn function(props, options) {\n\t\treturn useStore(StoreKlass, props, options);\n\t};\n}\nfunction createUseStoreSelector(StoreKlass, selector) {\n\treturn function(props) {\n\t\treturn useStore(StoreKlass, props, { selector });\n\t};\n}\nfunction useStoreSelector(StoreKlass, selector, props) {\n\treturn useStore(StoreKlass, props, { selector });\n}\nvar storeAccessTrackers = /* @__PURE__ */ new Set();\nfunction trackStoresAccess(cb) {\n\tstoreAccessTrackers.add(cb);\n\treturn function() {\n\t\tstoreAccessTrackers.delete(cb);\n\t};\n}\nfunction getStore(StoreKlass, props) {\n\tvar _getStoreInfo;\n\treturn (_getStoreInfo = getStoreInfo(StoreKlass, props)) === null || _getStoreInfo === void 0 ? void 0 : _getStoreInfo.store;\n}\nfunction getOrCreateStore(StoreKlass, props) {\n\tvar _getOrCreateStoreInfo;\n\treturn (_getOrCreateStoreInfo = getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: false })) === null || _getOrCreateStoreInfo === void 0 ? void 0 : _getOrCreateStoreInfo.store;\n}\nfunction getStoreInfo(StoreKlass, props) {\n\treturn getOrCreateStoreInfo(StoreKlass, props, { refuseCreation: true });\n}\nvar onCreateListeners = /* @__PURE__ */ new Set();\nfunction onCreateStore(cb) {\n\tonCreateListeners.add(cb);\n\treturn function() {\n\t\tonCreateListeners.delete(cb);\n\t};\n}\nfunction getOrCreateStoreInfo(StoreKlass, props, options, propsKeyCalculated) {\n\tvar _store_mount;\n\tif (!StoreKlass) return null;\n\tvar uid = getStoreUid(StoreKlass, propsKeyCalculated !== null && propsKeyCalculated !== void 0 ? propsKeyCalculated : props);\n\tif (!(options === null || options === void 0 ? void 0 : options.avoidCache) && cache.has(uid)) return cache.get(uid);\n\tif (options === null || options === void 0 ? void 0 : options.refuseCreation) throw new Error(`No store exists (${StoreKlass.name}) with props: ${props}`);\n\tvar storeInstance = new StoreKlass(props);\n\tstoreInstance.props = props;\n\tvar getters = {};\n\tvar actions = {};\n\tvar stateKeys = /* @__PURE__ */ new Set();\n\tvar descriptors = getStoreDescriptors(storeInstance);\n\tfor (var key in descriptors) {\n\t\tvar descriptor = descriptors[key];\n\t\tif (typeof descriptor.value === \"function\") actions[key] = descriptor.value;\n\t\telse if (typeof descriptor.get === \"function\") getters[key] = descriptor.get;\n\t\telse if (key !== \"props\" && key[0] !== \"_\") stateKeys.add(key);\n\t}\n\tvar keyComparators = storeInstance[\"_comparators\"];\n\tvar listeners = /* @__PURE__ */ new Set();\n\tvar storeInfo = {\n\t\tuid,\n\t\tkeyComparators,\n\t\tstoreInstance,\n\t\tgetters,\n\t\tstateKeys,\n\t\tprops,\n\t\tactions,\n\t\tdebug: options === null || options === void 0 ? void 0 : options.debug,\n\t\tdisableTracking: false,\n\t\tgettersState: {\n\t\t\tgetCache: /* @__PURE__ */ new Map(),\n\t\t\tdepsToGetter: /* @__PURE__ */ new Map(),\n\t\t\tcurGetKeys: /* @__PURE__ */ new Set(),\n\t\t\tisGetting: false\n\t\t},\n\t\tlisteners,\n\t\ttrackers: /* @__PURE__ */ new Set(),\n\t\tversion: 0,\n\t\tsubscribe: function(onChanged) {\n\t\t\tlisteners.add(onChanged);\n\t\t\treturn function() {\n\t\t\t\tlisteners.delete(onChanged);\n\t\t\t};\n\t\t},\n\t\ttriggerUpdate: function() {\n\t\t\tstoreInfo.version = (storeInfo.version + 1) % Number.MAX_SAFE_INTEGER;\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar cb = _step.value;\n\t\t\t\t\tcb();\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\tvar store = createProxiedStore(storeInfo);\n\tif (process.env.NODE_ENV === \"development\") allStores[StoreKlass.name + uid] = store;\n\t(_store_mount = store.mount) === null || _store_mount === void 0 || _store_mount.call(store);\n\tstoreInfo.store = store;\n\tvar result = storeInfo;\n\tcache.set(uid, result);\n\tonCreateListeners.forEach(function(cb) {\n\t\treturn cb(result);\n\t});\n\treturn result;\n}\nvar allStores = {};\nif (process.env.NODE_ENV === \"development\") {\n\tvar _globalThis, _Store;\n\t(_globalThis = globalThis)[_Store = \"Store\"] || (_globalThis[_Store] = allStores);\n}\nvar emptyObj = {};\nvar selectKeys = function(obj, keys) {\n\tif (!keys.length) return emptyObj;\n\tvar res = {};\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar key = _step.value;\n\t\t\tres[key] = obj[key];\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n\treturn res;\n};\nvar isInReaction = false;\nvar setIsInReaction = function(val) {\n\tisInReaction = val;\n};\nfunction useStoreFromInfo(info, userSelector, options) {\n\tvar store = info === null || info === void 0 ? void 0 : info.store;\n\tvar internal = React.useRef(void 0);\n\tvar component = useCurrentComponent();\n\tif (!internal.current) internal.current = {\n\t\tcomponent,\n\t\ttracked: /* @__PURE__ */ new Set(),\n\t\tlast: null,\n\t\tlastKeys: null\n\t};\n\tvar curInternal = internal.current;\n\tvar shouldPrintDebug = options === null || options === void 0 ? void 0 : options.debug;\n\tvar getSnapshot = React.useCallback(function() {\n\t\tif (!info || !store) return;\n\t\tvar curInternal2 = internal.current;\n\t\tvar isTracking = curInternal2.tracked.size;\n\t\tvar keys = [...!isTracking ? info.stateKeys : curInternal2.tracked];\n\t\tvar nextKeys = `${info.version}${keys.join(\"\")}${userSelector || \"\"}`;\n\t\tvar lastKeys = curInternal2.lastKeys;\n\t\tif (nextKeys === curInternal2.lastKeys) return curInternal2.last;\n\t\tcurInternal2.lastKeys = nextKeys;\n\t\tvar snap;\n\t\tinfo.disableTracking = true;\n\t\tvar last = curInternal2.last;\n\t\tif (userSelector) snap = userSelector(store);\n\t\telse snap = selectKeys(store, keys);\n\t\tinfo.disableTracking = false;\n\t\tvar isUnchanged = !userSelector && !isTracking && last || typeof last !== \"undefined\" && isEqualSubsetShallow(last, snap, { keyComparators: info.keyComparators });\n\t\tif (shouldPrintDebug) console.info(\"🌑 getSnapshot\", {\n\t\t\tstoreState: selectKeys(store, Object.keys(store)),\n\t\t\tuserSelector,\n\t\t\tinfo,\n\t\t\tisUnchanged,\n\t\t\tcomponent,\n\t\t\tkeys,\n\t\t\tlast,\n\t\t\tsnap,\n\t\t\tcurInternal: curInternal2,\n\t\t\tnextKeys,\n\t\t\tlastKeys\n\t\t});\n\t\tif (isUnchanged) return last;\n\t\tcurInternal2.last = snap;\n\t\treturn snap;\n\t}, [store]);\n\tvar state = React.useSyncExternalStore((info === null || info === void 0 ? void 0 : info.subscribe) || idFn, getSnapshot, getSnapshot);\n\tif (!info || !store || !state) return state;\n\tif (userSelector) return state;\n\treturn new Proxy(store, { get(target, key) {\n\t\tvar curVal = Reflect.get(target, key);\n\t\tif (isInReaction) return curVal;\n\t\tvar keyString = key;\n\t\tif (info.stateKeys.has(keyString) || keyString in info.getters) {\n\t\t\tif (shouldPrintDebug) console.info(\"👀 tracking\", keyString);\n\t\t\tcurInternal.tracked.add(keyString);\n\t\t}\n\t\tif (Reflect.has(state, key)) return Reflect.get(state, key);\n\t\treturn curVal;\n\t} });\n}\nvar setters = /* @__PURE__ */ new Set();\nvar logStack = /* @__PURE__ */ new Set();\nfunction createProxiedStore(storeInfo) {\n\tvar _loop = function(key2) {\n\t\tif (key2 === \"subscribe\") return \"continue\";\n\t\tvar actionFn = actions[key2];\n\t\tvar isGetFn = key2.startsWith(\"get\");\n\t\twrappedActions[key2] = function useStoreAction() {\n\t\t\tfor (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];\n\t\t\tvar res;\n\t\t\tif (isGetFn || gettersState.isGetting) return Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) startAction\", key2);\n\t\t\tres = Reflect.apply(actionFn, proxiedStore, args);\n\t\t\tif (_instanceof(res, Promise)) return res.then(finishAction);\n\t\t\tfinishAction();\n\t\t\treturn res;\n\t\t};\n\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\tlet hashCode2 = function(str) {\n\t\t\t\tvar hash = 0;\n\t\t\t\tfor (var i = 0; i < str.length; i++) hash = str.charCodeAt(i) + ((hash << 5) - hash);\n\t\t\t\treturn hash;\n\t\t\t}, strColor2 = function(str) {\n\t\t\t\treturn `hsl(${hashCode2(str) % 360}, 90%, 40%)`;\n\t\t\t};\n\t\t\tif (!key2.startsWith(\"get\") && !key2.startsWith(\"_\") && key2 !== \"subscribe\") {\n\t\t\t\tvar ogAction = wrappedActions[key2];\n\t\t\t\twrappedActions[key2] = new Proxy(ogAction, { apply(target, thisArg, args) {\n\t\t\t\t\tvar isDebugging = shouldDebug2 || storeInfo.debug;\n\t\t\t\t\tif (!(process.env.LOG_LEVEL !== \"0\" && (isDebugging || configureOpts.logLevel !== \"error\"))) return Reflect.apply(target, thisArg, args);\n\t\t\t\t\tsetters = /* @__PURE__ */ new Set();\n\t\t\t\t\tvar curSetters = setters;\n\t\t\t\t\tvar isTopLevelLogger = logStack.size == 0;\n\t\t\t\t\tvar logs = /* @__PURE__ */ new Set();\n\t\t\t\t\tlogStack.add(logs);\n\t\t\t\t\tvar res;\n\t\t\t\t\tvar id = counter++;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tres = Reflect.apply(target, thisArg, args);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tconsole.error(\"Error\", err);\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tlogStack.add(\"end\");\n\t\t\t\t\t\tvar name = constr.name;\n\t\t\t\t\t\tvar color = strColor2(name);\n\t\t\t\t\t\tvar simpleArgs = args.map(simpleStr);\n\t\t\t\t\t\tlogs.add([\n\t\t\t\t\t\t\t`%c \\u{1F311} ${id} ${name.padStart(isTopLevelLogger ? 8 : 4)}%c.${key2}(${simpleArgs.join(\", \")})${isTopLevelLogger && logStack.size > 1 ? ` (+${logStack.size - 1})` : \"\"}`,\n\t\t\t\t\t\t\t`color: ${color};`,\n\t\t\t\t\t\t\t\"color: black;\"\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tif (curSetters.size) curSetters.forEach(function(param) {\n\t\t\t\t\t\t\tvar { key: key3, value } = param;\n\t\t\t\t\t\t\tif (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") logs.add([` SET ${key3} ${value}`, value]);\n\t\t\t\t\t\t\telse logs.add([` SET ${key3}`, value]);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (isTopLevelLogger) {\n\t\t\t\t\t\t\tvar error = null;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tfor (var _iterator = logStack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\t\t\t\t\t\tvar item = _step.value;\n\t\t\t\t\t\t\t\t\t\tif (item === \"end\") {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvar [head, ...rest] = item;\n\t\t\t\t\t\t\t\t\t\tif (head) {\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(...head);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"...\");\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(\"args\", args);\n\t\t\t\t\t\t\t\t\t\t\tconsole.info(\"response\", res);\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(\"trace\");\n\t\t\t\t\t\t\t\t\t\t\tconsole.trace();\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var _iterator1 = rest[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar [name1, ...log] = _step1.value;\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.groupCollapsed(name1);\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.info(...log);\n\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t\t\t\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else console.info(\"Weird log\", head, ...rest);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t\t\t\t\t_iteratorError = err;\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\terror = err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfor (var _iterator2 = logStack[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\t\t\t\t\t\t_step2.value;\n\t\t\t\t\t\t\t\t\tconsole.groupEnd();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t_didIteratorError2 = true;\n\t\t\t\t\t\t\t\t_iteratorError2 = err;\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (error) console.error(`error loggin`, error);\n\t\t\t\t\t\t\tlogStack.clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t};\n\tvar { actions, storeInstance, getters, gettersState } = storeInfo;\n\tvar { getCache, curGetKeys, depsToGetter } = gettersState;\n\tvar constr = storeInstance.constructor;\n\tvar _storeInfo_debug;\n\tvar shouldDebug2 = (_storeInfo_debug = storeInfo.debug) !== null && _storeInfo_debug !== void 0 ? _storeInfo_debug : DebugStores.has(constr);\n\tvar didSet = false;\n\tvar wrappedActions = {};\n\tfor (var key in actions) _loop(key);\n\tvar finishAction = function(val) {\n\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"(debug) finishAction\", { didSet });\n\t\tif (didSet) {\n\t\t\tstoreInfo.triggerUpdate();\n\t\t\tdidSet = false;\n\t\t}\n\t\treturn val;\n\t};\n\tvar isTriggering = false;\n\tvar proxiedStore = new Proxy(storeInstance, {\n\t\tget(_, key2) {\n\t\t\tif (key2 in wrappedActions) return wrappedActions[key2];\n\t\t\tif (key2 in passThroughKeys) return Reflect.get(storeInstance, key2);\n\t\t\tif (key2 === UNWRAP_PROXY) return storeInstance;\n\t\t\tif (key2 === UNWRAP_STORE_INFO) return storeInfo;\n\t\t\tif (storeAccessTrackers.size) storeAccessTrackers.forEach(function(cb) {\n\t\t\t\treturn cb(storeInfo);\n\t\t\t});\n\t\t\tif (typeof key2 !== \"string\") return Reflect.get(storeInstance, key2);\n\t\t\tif (!storeInfo.disableTracking) {\n\t\t\t\tif (gettersState.isGetting) gettersState.curGetKeys.add(key2);\n\t\t\t}\n\t\t\tif (key2 in getters) {\n\t\t\t\tif (getCache.has(key2)) return getCache.get(key2);\n\t\t\t\tcurGetKeys.clear();\n\t\t\t\tvar isSubGetter = gettersState.isGetting;\n\t\t\t\tgettersState.isGetting = true;\n\t\t\t\tvar res = getters[key2].call(proxiedStore);\n\t\t\t\tif (!isSubGetter) gettersState.isGetting = false;\n\t\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator = curGetKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\t\tvar gk = _step.value;\n\t\t\t\t\t\tif (!depsToGetter.has(gk)) depsToGetter.set(gk, /* @__PURE__ */ new Set());\n\t\t\t\t\t\tdepsToGetter.get(gk).add(key2);\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t_iteratorError = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgetCache.set(key2, res);\n\t\t\t\treturn res;\n\t\t\t}\n\t\t\treturn Reflect.get(storeInstance, key2);\n\t\t},\n\t\tset(target, key2, value, receiver) {\n\t\t\tvar cur = Reflect.get(target, key2);\n\t\t\tvar res = Reflect.set(target, key2, value, receiver);\n\t\t\tif (res && cur !== value) {\n\t\t\t\tif (typeof key2 === \"string\") {\n\t\t\t\t\tclearGetterCache(key2);\n\t\t\t\t\tif (shouldDebug2) {\n\t\t\t\t\t\tsetters.add({\n\t\t\t\t\t\t\tkey: key2,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (getShouldDebug(storeInfo)) console.info(\"(debug) SET\", res, key2, value);\n\t\t\t\t\t}\n\t\t\t\t\tif (process.env.NODE_ENV === \"development\" && shouldDebug2) console.info(\"SET...\", {\n\t\t\t\t\t\tkey: key2,\n\t\t\t\t\t\tvalue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (!isTriggering) {\n\t\t\t\t\tisTriggering = true;\n\t\t\t\t\twaitForEventLoop(function() {\n\t\t\t\t\t\tstoreInfo.triggerUpdate();\n\t\t\t\t\t\tisTriggering = false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t});\n\tfunction clearGetterCache(setKey) {\n\t\tvar parentGetters = depsToGetter.get(setKey);\n\t\tgetCache.delete(setKey);\n\t\tif (!parentGetters) return;\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = parentGetters[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar gk = _step.value;\n\t\t\t\tgetCache.delete(gk);\n\t\t\t\tif (depsToGetter.has(gk)) clearGetterCache(gk);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\treturn proxiedStore;\n}\nvar waitForEventLoop = (process.env.NODE_ENV, function(cb) {\n\treturn cb();\n});\nvar counter = 0;\nvar passThroughKeys = {\n\tsubscribe: true,\n\t_version: true,\n\t_trackers: true,\n\t$$typeof: true,\n\t_listeners: true,\n\t_enableTracking: true\n};\nfunction getShouldDebug(storeInfo) {\n\tvar info = { storeInstance: storeInfo.store };\n\treturn [...storeInfo.trackers].some(function(tracker) {\n\t\treturn tracker.component && shouldDebug(tracker.component, info);\n\t});\n}\n\nexport { allStores, createStore, createUseStore, createUseStoreSelector, getOrCreateStore, getStore, getStoreInfo, onCreateStore, setIsInReaction, trackStoresAccess, useGlobalStore, useGlobalStoreSelector, useStore, useStoreDebug, useStoreSelector };"],"mappings":";;;;;;;;AAOA,SAAS,YAAY,MAAM,OAAO;CACjC,IAAI,SAAS,QAAQ,OAAO,WAAW,eAAe,MAAM,OAAO,cAAc,OAAO,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,IAAI;MACnH,OAAO,gBAAgB;AAC7B;AACA,IAAI,OAAO,SAAS,GAAG;CACtB,OAAO;AACR;AACA,SAAS,SAAS,YAAY,OAAO;CAC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BAAoB,QAAQ,IAAI,UAAU,SAAS,IAAI;CAC1D,OAAO,GAAG;AACX;AACA,IAAI,UAAU;AACd,IAAI,kBAAkB;CACrB,WAAW;CACX,UAAU;CACV,WAAW;CACX,UAAU;CACV,YAAY;CACZ,iBAAiB;AAClB;AACA,SAAS,eAAe,WAAW;CAClC,IAAI,OAAO,EAAE,eAAe,UAAU,MAAM;CAC5C,OAAO,CAAC,GAAG,UAAU,QAAQ,CAAC,CAAC,KAAK,SAAS,SAAS;EACrD,OAAO,QAAQ,aAAa,YAAY,QAAQ,WAAW,IAAI;CAChE,CAAC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStoreDebug.js","names":[],"sources":["esm/useStoreDebug.js"],"sourcesContent":["import React from \"react\";\nconst useCurrentComponent = () => {\n return {};\n};\nfunction useDebugStoreComponent(StoreCons) {\n const cmp = useCurrentComponent();\n DebugStores.add(StoreCons);\n if (!DebugComponents.has(cmp)) {\n DebugComponents.set(cmp, /* @__PURE__ */ new Set());\n }\n const stores = DebugComponents.get(cmp);\n stores.add(StoreCons);\n React.useLayoutEffect(() => {\n return () => {\n DebugStores.delete(StoreCons);\n stores.delete(StoreCons);\n };\n }, []);\n}\nconst shouldDebug = (component, info) => {\n const StoreCons = info.storeInstance?.constructor;\n return DebugComponents.get(component)?.has(StoreCons);\n};\nconst DebugComponents = /* @__PURE__ */ new Map();\nconst DebugStores = /* @__PURE__ */ new Set();\nexport {\n DebugComponents,\n DebugStores,\n shouldDebug,\n useCurrentComponent,\n useDebugStoreComponent\n};\n//# sourceMappingURL=useStoreDebug.js.map\n"],"mappings":";;;AACA,MAAM,4BAA4B;CAChC,OAAO,CAAC;AACV;AACA,SAAS,uBAAuB,WAAW;CACzC,MAAM,MAAM,oBAAoB;CAChC,YAAY,IAAI,SAAS;CACzB,IAAI,CAAC,gBAAgB,IAAI,GAAG,GAAG;EAC7B,gBAAgB,IAAI,qBAAqB,IAAI,IAAI,CAAC;CACpD;CACA,MAAM,SAAS,gBAAgB,IAAI,GAAG;CACtC,OAAO,IAAI,SAAS;CACpB,MAAM,sBAAsB;EAC1B,aAAa;GACX,YAAY,OAAO,SAAS;GAC5B,OAAO,OAAO,SAAS;EACzB;CACF,GAAG,CAAC,CAAC;AACP;AACA,MAAM,eAAe,WAAW,SAAS;CACvC,MAAM,YAAY,KAAK,eAAe;CACtC,OAAO,gBAAgB,IAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"useStoreDebug.js","names":[],"sources":["esm/useStoreDebug.js"],"sourcesContent":["import React from \"react\";\nconst useCurrentComponent = () => {\n return {};\n};\nfunction useDebugStoreComponent(StoreCons) {\n const cmp = useCurrentComponent();\n DebugStores.add(StoreCons);\n if (!DebugComponents.has(cmp)) {\n DebugComponents.set(cmp, /* @__PURE__ */ new Set());\n }\n const stores = DebugComponents.get(cmp);\n stores.add(StoreCons);\n React.useLayoutEffect(() => {\n return () => {\n DebugStores.delete(StoreCons);\n stores.delete(StoreCons);\n };\n }, []);\n}\nconst shouldDebug = (component, info) => {\n const StoreCons = info.storeInstance?.constructor;\n return DebugComponents.get(component)?.has(StoreCons);\n};\nconst DebugComponents = /* @__PURE__ */ new Map();\nconst DebugStores = /* @__PURE__ */ new Set();\nexport {\n DebugComponents,\n DebugStores,\n shouldDebug,\n useCurrentComponent,\n useDebugStoreComponent\n};\n//# sourceMappingURL=useStoreDebug.js.map\n"],"mappings":";;;AACA,MAAM,4BAA4B;CAChC,OAAO,CAAC;AACV;AACA,SAAS,uBAAuB,WAAW;CACzC,MAAM,MAAM,oBAAoB;CAChC,YAAY,IAAI,SAAS;CACzB,IAAI,CAAC,gBAAgB,IAAI,GAAG,GAAG;EAC7B,gBAAgB,IAAI,qBAAqB,IAAI,IAAI,CAAC;CACpD;CACA,MAAM,SAAS,gBAAgB,IAAI,GAAG;CACtC,OAAO,IAAI,SAAS;CACpB,MAAM,sBAAsB;EAC1B,aAAa;GACX,YAAY,OAAO,SAAS;GAC5B,OAAO,OAAO,SAAS;EACzB;CACF,GAAG,CAAC,CAAC;AACP;AACA,MAAM,eAAe,WAAW,SAAS;CACvC,MAAM,YAAY,KAAK,eAAe;CACtC,OAAO,gBAAgB,IAAI,SAAS,CAAC,EAAE,IAAI,SAAS;AACtD;AACA,MAAM,kCAAkC,IAAI,IAAI;AAChD,MAAM,8BAA8B,IAAI,IAAI"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-store",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.728.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"src",
|
|
6
6
|
"types",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"clean:build": "tamagui-build clean:build"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tamagui/simple-hash": "3.0.0-beta.
|
|
36
|
+
"@tamagui/simple-hash": "3.0.0-beta.728.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@tamagui/build": "3.0.0-beta.
|
|
39
|
+
"@tamagui/build": "3.0.0-beta.728.1",
|
|
40
40
|
"@testing-library/react": "^16.1.0",
|
|
41
|
-
"react": "
|
|
41
|
+
"react": "19.2.3",
|
|
42
42
|
"vitest": "4.0.4"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|