@tamagui/use-store 1.61.3 → 1.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/cjs/comparators.js +12 -18
  2. package/dist/cjs/comparators.js.map +1 -1
  3. package/dist/cjs/comparators.native.js +40 -0
  4. package/dist/cjs/comparators.native.js.map +6 -0
  5. package/dist/cjs/configureUseStore.js +5 -9
  6. package/dist/cjs/configureUseStore.js.map +1 -1
  7. package/dist/cjs/configureUseStore.native.js +31 -0
  8. package/dist/cjs/configureUseStore.native.js.map +6 -0
  9. package/dist/cjs/constants.js +7 -12
  10. package/dist/cjs/constants.js.map +1 -1
  11. package/dist/cjs/constants.native.js +31 -0
  12. package/dist/cjs/constants.native.js.map +6 -0
  13. package/dist/cjs/decorators.js +6 -11
  14. package/dist/cjs/decorators.js.map +1 -1
  15. package/dist/cjs/decorators.native.js +30 -0
  16. package/dist/cjs/decorators.native.js.map +6 -0
  17. package/dist/cjs/helpers.js +13 -29
  18. package/dist/cjs/helpers.js.map +1 -1
  19. package/dist/cjs/helpers.native.js +66 -0
  20. package/dist/cjs/helpers.native.js.map +6 -0
  21. package/dist/cjs/index.js +6 -11
  22. package/dist/cjs/index.js.map +1 -1
  23. package/dist/cjs/index.native.js +46 -0
  24. package/dist/cjs/index.native.js.map +6 -0
  25. package/dist/cjs/interfaces.js +3 -6
  26. package/dist/cjs/interfaces.js.map +1 -1
  27. package/dist/cjs/interfaces.native.js +15 -0
  28. package/dist/cjs/interfaces.native.js.map +6 -0
  29. package/dist/cjs/observe.js +35 -92
  30. package/dist/cjs/observe.js.map +1 -1
  31. package/dist/cjs/observe.native.js +103 -0
  32. package/dist/cjs/observe.native.js.map +6 -0
  33. package/dist/cjs/useStore.js +114 -318
  34. package/dist/cjs/useStore.js.map +2 -2
  35. package/dist/cjs/useStore.native.js +350 -0
  36. package/dist/cjs/useStore.native.js.map +6 -0
  37. package/dist/cjs/useStoreDebug.js +14 -33
  38. package/dist/cjs/useStoreDebug.js.map +1 -1
  39. package/dist/cjs/useStoreDebug.native.js +55 -0
  40. package/dist/cjs/useStoreDebug.native.js.map +6 -0
  41. package/dist/esm/comparators.js +7 -9
  42. package/dist/esm/comparators.js.map +1 -1
  43. package/dist/esm/constants.js +2 -3
  44. package/dist/esm/constants.js.map +1 -1
  45. package/dist/esm/decorators.js +1 -2
  46. package/dist/esm/decorators.js.map +1 -1
  47. package/dist/esm/helpers.js +7 -18
  48. package/dist/esm/helpers.js.map +1 -1
  49. package/dist/esm/observe.js +29 -79
  50. package/dist/esm/observe.js.map +1 -1
  51. package/dist/esm/useStore.js +108 -303
  52. package/dist/esm/useStore.js.map +2 -2
  53. package/dist/esm/useStoreDebug.js +7 -20
  54. package/dist/esm/useStoreDebug.js.map +1 -1
  55. package/package.json +4 -4
@@ -1,40 +1,34 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var comparators_exports = {};
20
16
  __export(comparators_exports, {
21
17
  isEqualSubsetShallow: () => isEqualSubsetShallow
22
18
  });
23
19
  module.exports = __toCommonJS(comparators_exports);
24
20
  const isEqualSubsetShallow = (a, b, opts) => {
25
- var _a;
26
21
  if (b == null || a == null)
27
22
  return a === b;
28
- if (typeof a !== typeof b)
29
- return false;
30
- if (typeof b === "object") {
23
+ if (typeof a != typeof b)
24
+ return !1;
25
+ if (typeof b == "object") {
31
26
  for (const key in b) {
32
- const compare = (_a = opts == null ? void 0 : opts.keyComparators) == null ? void 0 : _a[key];
33
- if (compare ? !compare(a[key], b[key]) : b[key] !== a[key]) {
34
- return false;
35
- }
27
+ const compare = opts?.keyComparators?.[key];
28
+ if (compare ? !compare(a[key], b[key]) : b[key] !== a[key])
29
+ return !1;
36
30
  }
37
- return true;
31
+ return !0;
38
32
  }
39
33
  return a === b;
40
34
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/comparators.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,uBAAuB,CAClC,GACA,GACA,SACG;AAJL;AAKE,MAAI,KAAK,QAAQ,KAAK;AAAM,WAAO,MAAM;AACzC,MAAI,OAAO,MAAM,OAAO;AAAG,WAAO;AAClC,MAAI,OAAO,MAAM,UAAU;AACzB,eAAW,OAAO,GAAG;AACnB,YAAM,WAAU,kCAAM,mBAAN,mBAAuB;AACvC,UAAI,UAAU,CAAC,QAAQ,EAAE,GAAG,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG,GAAG;AAC1D,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACA,SAAO,MAAM;AACf;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,uBAAuB,CAClC,GACA,GACA,SACG;AACH,MAAI,KAAK,QAAQ,KAAK;AAAM,WAAO,MAAM;AACzC,MAAI,OAAO,KAAM,OAAO;AAAG,WAAO;AAClC,MAAI,OAAO,KAAM,UAAU;AACzB,eAAW,OAAO,GAAG;AACnB,YAAM,UAAU,MAAM,iBAAiB,GAAG;AAC1C,UAAI,UAAU,CAAC,QAAQ,EAAE,GAAG,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG;AACvD,eAAO;AAAA,IAEX;AACA,WAAO;AAAA,EACT;AACA,SAAO,MAAM;AACf;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var comparators_exports = {};
17
+ __export(comparators_exports, {
18
+ isEqualSubsetShallow: () => isEqualSubsetShallow
19
+ });
20
+ module.exports = __toCommonJS(comparators_exports);
21
+ const isEqualSubsetShallow = (a, b, opts) => {
22
+ if (b == null || a == null)
23
+ return a === b;
24
+ if (typeof a != typeof b)
25
+ return !1;
26
+ if (typeof b == "object") {
27
+ for (const key in b) {
28
+ const compare = opts?.keyComparators?.[key];
29
+ if (compare ? !compare(a[key], b[key]) : b[key] !== a[key])
30
+ return !1;
31
+ }
32
+ return !0;
33
+ }
34
+ return a === b;
35
+ };
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ isEqualSubsetShallow
39
+ });
40
+ //# sourceMappingURL=comparators.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/comparators.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,uBAAuB,CAClC,GACA,GACA,SACG;AACH,MAAI,KAAK,QAAQ,KAAK;AAAM,WAAO,MAAM;AACzC,MAAI,OAAO,KAAM,OAAO;AAAG,WAAO;AAClC,MAAI,OAAO,KAAM,UAAU;AACzB,eAAW,OAAO,GAAG;AACnB,YAAM,UAAU,MAAM,iBAAiB,GAAG;AAC1C,UAAI,UAAU,CAAC,QAAQ,EAAE,GAAG,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG;AACvD,eAAO;AAAA,IAEX;AACA,WAAO;AAAA,EACT;AACA,SAAO,MAAM;AACf;",
5
+ "names": []
6
+ }
@@ -1,21 +1,17 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var configureUseStore_exports = {};
20
16
  __export(configureUseStore_exports, {
21
17
  configureOpts: () => configureOpts,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/configureUseStore.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAI,gBAAgC,CAAC;AAErC,SAAS,kBAAkB,MAAsB;AACtD,kBAAgB;AAClB;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAI,gBAAgC,CAAC;AAErC,SAAS,kBAAkB,MAAsB;AACtD,kBAAgB;AAClB;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var configureUseStore_exports = {};
17
+ __export(configureUseStore_exports, {
18
+ configureOpts: () => configureOpts,
19
+ configureUseStore: () => configureUseStore
20
+ });
21
+ module.exports = __toCommonJS(configureUseStore_exports);
22
+ let configureOpts = {};
23
+ function configureUseStore(opts) {
24
+ configureOpts = opts;
25
+ }
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ configureOpts,
29
+ configureUseStore
30
+ });
31
+ //# sourceMappingURL=configureUseStore.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/configureUseStore.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,IAAI,gBAAgC,CAAC;AAErC,SAAS,kBAAkB,MAAsB;AACtD,kBAAgB;AAClB;",
5
+ "names": []
6
+ }
@@ -1,30 +1,25 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var constants_exports = {};
20
16
  __export(constants_exports, {
21
17
  UNWRAP_PROXY: () => UNWRAP_PROXY,
22
18
  defaultOptions: () => defaultOptions
23
19
  });
24
20
  module.exports = __toCommonJS(constants_exports);
25
- const UNWRAP_PROXY = Symbol();
26
- const defaultOptions = {
27
- once: false,
21
+ const UNWRAP_PROXY = Symbol(), defaultOptions = {
22
+ once: !1,
28
23
  selector: void 0
29
24
  };
30
25
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,OAAO;AAE5B,MAAM,iBAAiB;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AACZ;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,OAAO,GAEtB,iBAAiB;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AACZ;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var constants_exports = {};
17
+ __export(constants_exports, {
18
+ UNWRAP_PROXY: () => UNWRAP_PROXY,
19
+ defaultOptions: () => defaultOptions
20
+ });
21
+ module.exports = __toCommonJS(constants_exports);
22
+ const UNWRAP_PROXY = Symbol(), defaultOptions = {
23
+ once: !1,
24
+ selector: void 0
25
+ };
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ UNWRAP_PROXY,
29
+ defaultOptions
30
+ });
31
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/constants.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,OAAO,GAEtB,iBAAiB;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AACZ;",
5
+ "names": []
6
+ }
@@ -1,21 +1,17 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var decorators_exports = {};
20
16
  __export(decorators_exports, {
21
17
  compare: () => compare
@@ -23,8 +19,7 @@ __export(decorators_exports, {
23
19
  module.exports = __toCommonJS(decorators_exports);
24
20
  function compare(comparator) {
25
21
  return (target, propertyKey) => {
26
- target["_comparators"] = target["_comparators"] || {};
27
- target["_comparators"][propertyKey] = comparator;
22
+ target._comparators = target._comparators || {}, target._comparators[propertyKey] = comparator;
28
23
  };
29
24
  }
30
25
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/decorators.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,QAAQ,YAA0B;AAChD,SAAO,CAAC,QAAa,gBAA6B;AAChD,WAAO,cAAc,IAAI,OAAO,cAAc,KAAK,CAAC;AACpD,WAAO,cAAc,EAAE,WAAW,IAAI;AAAA,EACxC;AACF;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,QAAQ,YAA0B;AAChD,SAAO,CAAC,QAAa,gBAA6B;AAChD,WAAO,eAAkB,OAAO,gBAAmB,CAAC,GACpD,OAAO,aAAgB,WAAW,IAAI;AAAA,EACxC;AACF;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var decorators_exports = {};
17
+ __export(decorators_exports, {
18
+ compare: () => compare
19
+ });
20
+ module.exports = __toCommonJS(decorators_exports);
21
+ function compare(comparator) {
22
+ return (target, propertyKey) => {
23
+ target._comparators = target._comparators || {}, target._comparators[propertyKey] = comparator;
24
+ };
25
+ }
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ compare
29
+ });
30
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/decorators.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,QAAQ,YAA0B;AAChD,SAAO,CAAC,QAAa,gBAA6B;AAChD,WAAO,eAAkB,OAAO,gBAAmB,CAAC,GACpD,OAAO,aAAgB,WAAW,IAAI;AAAA,EACxC;AACF;",
5
+ "names": []
6
+ }
@@ -1,21 +1,17 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
13
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
19
15
  var helpers_exports = {};
20
16
  __export(helpers_exports, {
21
17
  UNWRAP_STORE_INFO: () => UNWRAP_STORE_INFO,
@@ -28,42 +24,30 @@ __export(helpers_exports, {
28
24
  simpleStr: () => simpleStr
29
25
  });
30
26
  module.exports = __toCommonJS(helpers_exports);
31
- var import_simple_hash = require("@tamagui/simple-hash");
32
- var import_react = require("react");
27
+ var import_simple_hash = require("@tamagui/simple-hash"), import_react = require("react");
33
28
  function getStoreUid(Constructor, props) {
34
29
  return (0, import_simple_hash.simpleHash)(
35
- `${Constructor}${!props ? "" : typeof props === "string" ? props : JSON.stringify(props)}`,
30
+ `${Constructor}${props ? typeof props == "string" ? props : JSON.stringify(props) : ""}`,
36
31
  "strict"
37
32
  );
38
33
  }
39
- const UNWRAP_STORE_INFO = Symbol("UNWRAP_STORE_INFO");
40
- const cache = /* @__PURE__ */ new Map();
34
+ const UNWRAP_STORE_INFO = Symbol("UNWRAP_STORE_INFO"), cache = /* @__PURE__ */ new Map();
41
35
  function getStoreDescriptors(storeInstance) {
42
- const proto = Object.getPrototypeOf(storeInstance);
43
- const instanceDescriptors = Object.getOwnPropertyDescriptors(storeInstance);
44
- const protoDescriptors = Object.getOwnPropertyDescriptors(proto);
45
- const descriptors = {
46
- ...protoDescriptors,
36
+ const proto = Object.getPrototypeOf(storeInstance), instanceDescriptors = Object.getOwnPropertyDescriptors(storeInstance), descriptors = {
37
+ ...Object.getOwnPropertyDescriptors(proto),
47
38
  ...instanceDescriptors
48
39
  };
49
- delete descriptors.constructor;
50
- return descriptors;
40
+ return delete descriptors.constructor, descriptors;
51
41
  }
52
42
  function get(_, b) {
53
43
  return _;
54
44
  }
55
45
  function useConstant(fn) {
56
46
  const ref = (0, import_react.useRef)();
57
- if (!ref.current) {
58
- ref.current = { v: fn() };
59
- }
60
- return ref.current.v;
47
+ return ref.current || (ref.current = { v: fn() }), ref.current.v;
61
48
  }
62
49
  function simpleStr(arg) {
63
- if (process.env.NODE_ENV === "development") {
64
- return typeof arg === "function" ? "fn" : typeof arg === "string" ? `"${arg}"` : !arg ? arg : typeof arg !== "object" ? arg : Array.isArray(arg) ? "[...]" : `{...}`;
65
- }
66
- return arg;
50
+ return process.env.NODE_ENV === "development" ? typeof arg == "function" ? "fn" : typeof arg == "string" ? `"${arg}"` : arg && (typeof arg != "object" ? arg : Array.isArray(arg) ? "[...]" : "{...}") : arg;
67
51
  }
68
52
  function getStoreDebugInfo(store) {
69
53
  return store[UNWRAP_STORE_INFO] ?? cache.get(getStoreUid(store.constructor, store.props));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/helpers.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA2B;AAC3B,mBAAuB;AAIhB,SAAS,YAAY,aAAkB,OAA+B;AAC3E,aAAO;AAAA,IACL,GAAG,WAAW,GACZ,CAAC,QAAQ,KAAK,OAAO,UAAU,WAAW,QAAQ,KAAK,UAAU,KAAK,CACxE;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,oBAAoB,OAAO,mBAAmB;AACpD,MAAM,QAAQ,oBAAI,IAAuB;AAEzC,SAAS,oBAAoB,eAAoB;AACtD,QAAM,QAAQ,OAAO,eAAe,aAAa;AACjD,QAAM,sBAAsB,OAAO,0BAA0B,aAAa;AAC1E,QAAM,mBAAmB,OAAO,0BAA0B,KAAK;AAC/D,QAAM,cAAc;AAAA,IAClB,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,SAAO,YAAY;AACnB,SAAO;AACT;AAEO,SAAS,IAAO,GAAM,GAAyD;AACpF,SAAO;AACT;AAIe,SAAR,YAAgC,IAAgB;AACrD,QAAM,UAAM,qBAAqB;AACjC,MAAI,CAAC,IAAI,SAAS;AAChB,QAAI,UAAU,EAAE,GAAG,GAAG,EAAE;AAAA,EAC1B;AACA,SAAO,IAAI,QAAQ;AACrB;AAEO,SAAS,UAAU,KAAU;AAClC,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,WAAO,OAAO,QAAQ,aAClB,OACA,OAAO,QAAQ,WACf,IAAI,GAAG,MACP,CAAC,MACD,MACA,OAAO,QAAQ,WACf,MACA,MAAM,QAAQ,GAAG,IACjB,UACA;AAAA,EACN;AACA,SAAO;AACT;AAGO,SAAS,kBAAkB,OAAY;AAC5C,SACE,MAAM,iBAAiB,KAAK,MAAM,IAAI,YAAY,MAAM,aAAa,MAAM,KAAK,CAAC;AAErF;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA2B,iCAC3B,eAAuB;AAIhB,SAAS,YAAY,aAAkB,OAA+B;AAC3E,aAAO;AAAA,IACL,GAAG,WAAW,GACX,QAAa,OAAO,SAAU,WAAW,QAAQ,KAAK,UAAU,KAAK,IAA7D,EACX;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,oBAAoB,OAAO,mBAAmB,GAC9C,QAAQ,oBAAI,IAAuB;AAEzC,SAAS,oBAAoB,eAAoB;AACtD,QAAM,QAAQ,OAAO,eAAe,aAAa,GAC3C,sBAAsB,OAAO,0BAA0B,aAAa,GAEpE,cAAc;AAAA,IAClB,GAFuB,OAAO,0BAA0B,KAAK;AAAA,IAG7D,GAAG;AAAA,EACL;AAEA,gBAAO,YAAY,aACZ;AACT;AAEO,SAAS,IAAO,GAAM,GAAyD;AACpF,SAAO;AACT;AAIe,SAAR,YAAgC,IAAgB;AACrD,QAAM,UAAM,qBAAqB;AACjC,SAAK,IAAI,YACP,IAAI,UAAU,EAAE,GAAG,GAAG,EAAE,IAEnB,IAAI,QAAQ;AACrB;AAEO,SAAS,UAAU,KAAU;AAClC,SAAI,QAAQ,IAAI,aAAa,gBACpB,OAAO,OAAQ,aAClB,OACA,OAAO,OAAQ,WACf,IAAI,GAAG,MACN,QAED,OAAO,OAAQ,WACf,MACA,MAAM,QAAQ,GAAG,IACjB,UACA,WAEC;AACT;AAGO,SAAS,kBAAkB,OAAY;AAC5C,SACE,MAAM,iBAAiB,KAAK,MAAM,IAAI,YAAY,MAAM,aAAa,MAAM,KAAK,CAAC;AAErF;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var helpers_exports = {};
17
+ __export(helpers_exports, {
18
+ UNWRAP_STORE_INFO: () => UNWRAP_STORE_INFO,
19
+ cache: () => cache,
20
+ default: () => useConstant,
21
+ get: () => get,
22
+ getStoreDebugInfo: () => getStoreDebugInfo,
23
+ getStoreDescriptors: () => getStoreDescriptors,
24
+ getStoreUid: () => getStoreUid,
25
+ simpleStr: () => simpleStr
26
+ });
27
+ module.exports = __toCommonJS(helpers_exports);
28
+ var import_simple_hash = require("@tamagui/simple-hash"), import_react = require("react");
29
+ function getStoreUid(Constructor, props) {
30
+ return (0, import_simple_hash.simpleHash)(
31
+ `${Constructor}${props ? typeof props == "string" ? props : JSON.stringify(props) : ""}`,
32
+ "strict"
33
+ );
34
+ }
35
+ const UNWRAP_STORE_INFO = Symbol("UNWRAP_STORE_INFO"), cache = /* @__PURE__ */ new Map();
36
+ function getStoreDescriptors(storeInstance) {
37
+ const proto = Object.getPrototypeOf(storeInstance), instanceDescriptors = Object.getOwnPropertyDescriptors(storeInstance), descriptors = {
38
+ ...Object.getOwnPropertyDescriptors(proto),
39
+ ...instanceDescriptors
40
+ };
41
+ return delete descriptors.constructor, descriptors;
42
+ }
43
+ function get(_, b) {
44
+ return _;
45
+ }
46
+ function useConstant(fn) {
47
+ const ref = (0, import_react.useRef)();
48
+ return ref.current || (ref.current = { v: fn() }), ref.current.v;
49
+ }
50
+ function simpleStr(arg) {
51
+ return process.env.NODE_ENV === "development" ? typeof arg == "function" ? "fn" : typeof arg == "string" ? `"${arg}"` : arg && (typeof arg != "object" ? arg : Array.isArray(arg) ? "[...]" : "{...}") : arg;
52
+ }
53
+ function getStoreDebugInfo(store) {
54
+ return store[UNWRAP_STORE_INFO] ?? cache.get(getStoreUid(store.constructor, store.props));
55
+ }
56
+ // Annotate the CommonJS export names for ESM import in node:
57
+ 0 && (module.exports = {
58
+ UNWRAP_STORE_INFO,
59
+ cache,
60
+ get,
61
+ getStoreDebugInfo,
62
+ getStoreDescriptors,
63
+ getStoreUid,
64
+ simpleStr
65
+ });
66
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/helpers.tsx"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA2B,iCAC3B,eAAuB;AAIhB,SAAS,YAAY,aAAkB,OAA+B;AAC3E,aAAO;AAAA,IACL,GAAG,WAAW,GACX,QAAa,OAAO,SAAU,WAAW,QAAQ,KAAK,UAAU,KAAK,IAA7D,EACX;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,oBAAoB,OAAO,mBAAmB,GAC9C,QAAQ,oBAAI,IAAuB;AAEzC,SAAS,oBAAoB,eAAoB;AACtD,QAAM,QAAQ,OAAO,eAAe,aAAa,GAC3C,sBAAsB,OAAO,0BAA0B,aAAa,GAEpE,cAAc;AAAA,IAClB,GAFuB,OAAO,0BAA0B,KAAK;AAAA,IAG7D,GAAG;AAAA,EACL;AAEA,gBAAO,YAAY,aACZ;AACT;AAEO,SAAS,IAAO,GAAM,GAAyD;AACpF,SAAO;AACT;AAIe,SAAR,YAAgC,IAAgB;AACrD,QAAM,UAAM,qBAAqB;AACjC,SAAK,IAAI,YACP,IAAI,UAAU,EAAE,GAAG,GAAG,EAAE,IAEnB,IAAI,QAAQ;AACrB;AAEO,SAAS,UAAU,KAAU;AAClC,SAAI,QAAQ,IAAI,aAAa,gBACpB,OAAO,OAAQ,aAClB,OACA,OAAO,OAAQ,WACf,IAAI,GAAG,MACN,QAED,OAAO,OAAQ,WACf,MACA,MAAM,QAAQ,GAAG,IACjB,UACA,WAEC;AACT;AAGO,SAAS,kBAAkB,OAAY;AAC5C,SACE,MAAM,iBAAiB,KAAK,MAAM,IAAI,YAAY,MAAM,aAAa,MAAM,KAAK,CAAC;AAErF;",
5
+ "names": []
6
+ }
package/dist/cjs/index.js CHANGED
@@ -1,22 +1,17 @@
1
- "use strict";
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
5
  var __export = (target, all) => {
7
6
  for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
12
10
  for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
12
  return to;
17
- };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
13
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
20
15
  var src_exports = {};
21
16
  __export(src_exports, {
22
17
  Store: () => Store,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,uBAAd;AACA,+BAAkC;AAClC,wBAAc,yBAFd;AAGA,wBAAc,sBAHd;AAIA,uBAA6B;AAC7B,wBAAc,0BALd;AAMA,wBAAc,yBANd;AASO,MAAM,MAAyC;AAAA,EACpD,YAAmB,OAAc;AAAd;AAAA,EAAe;AACpC;",
4
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,uBAAd;AACA,+BAAkC;AAClC,wBAAc,yBAFd;AAGA,wBAAc,sBAHd;AAIA,uBAA6B;AAC7B,wBAAc,0BALd;AAMA,wBAAc,yBANd;AASO,MAAM,MAAyC;AAAA,EACpD,YAAmB,OAAc;AAAd;AAAA,EAAe;AACpC;",
5
5
  "names": []
6
6
  }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var src_exports = {};
17
+ __export(src_exports, {
18
+ Store: () => Store,
19
+ UNWRAP_PROXY: () => import_constants.UNWRAP_PROXY,
20
+ configureUseStore: () => import_configureUseStore.configureUseStore
21
+ });
22
+ module.exports = __toCommonJS(src_exports);
23
+ __reExport(src_exports, require("./useStore"), module.exports);
24
+ var import_configureUseStore = require("./configureUseStore");
25
+ __reExport(src_exports, require("./interfaces"), module.exports);
26
+ __reExport(src_exports, require("./observe"), module.exports);
27
+ var import_constants = require("./constants");
28
+ __reExport(src_exports, require("./comparators"), module.exports);
29
+ __reExport(src_exports, require("./decorators"), module.exports);
30
+ class Store {
31
+ constructor(props) {
32
+ this.props = props;
33
+ }
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ Store,
38
+ UNWRAP_PROXY,
39
+ configureUseStore,
40
+ ...require("./useStore"),
41
+ ...require("./interfaces"),
42
+ ...require("./observe"),
43
+ ...require("./comparators"),
44
+ ...require("./decorators")
45
+ });
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,uBAAd;AACA,+BAAkC;AAClC,wBAAc,yBAFd;AAGA,wBAAc,sBAHd;AAIA,uBAA6B;AAC7B,wBAAc,0BALd;AAMA,wBAAc,yBANd;AASO,MAAM,MAAyC;AAAA,EACpD,YAAmB,OAAc;AAAd;AAAA,EAAe;AACpC;",
5
+ "names": []
6
+ }