@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.
- package/dist/cjs/comparators.js +12 -18
- package/dist/cjs/comparators.js.map +1 -1
- package/dist/cjs/comparators.native.js +40 -0
- package/dist/cjs/comparators.native.js.map +6 -0
- package/dist/cjs/configureUseStore.js +5 -9
- package/dist/cjs/configureUseStore.js.map +1 -1
- package/dist/cjs/configureUseStore.native.js +31 -0
- package/dist/cjs/configureUseStore.native.js.map +6 -0
- package/dist/cjs/constants.js +7 -12
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/constants.native.js +31 -0
- package/dist/cjs/constants.native.js.map +6 -0
- package/dist/cjs/decorators.js +6 -11
- package/dist/cjs/decorators.js.map +1 -1
- package/dist/cjs/decorators.native.js +30 -0
- package/dist/cjs/decorators.native.js.map +6 -0
- package/dist/cjs/helpers.js +13 -29
- package/dist/cjs/helpers.js.map +1 -1
- package/dist/cjs/helpers.native.js +66 -0
- package/dist/cjs/helpers.native.js.map +6 -0
- package/dist/cjs/index.js +6 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +46 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/cjs/interfaces.js +3 -6
- package/dist/cjs/interfaces.js.map +1 -1
- package/dist/cjs/interfaces.native.js +15 -0
- package/dist/cjs/interfaces.native.js.map +6 -0
- package/dist/cjs/observe.js +35 -92
- package/dist/cjs/observe.js.map +1 -1
- package/dist/cjs/observe.native.js +103 -0
- package/dist/cjs/observe.native.js.map +6 -0
- package/dist/cjs/useStore.js +114 -318
- package/dist/cjs/useStore.js.map +2 -2
- package/dist/cjs/useStore.native.js +350 -0
- package/dist/cjs/useStore.native.js.map +6 -0
- package/dist/cjs/useStoreDebug.js +14 -33
- package/dist/cjs/useStoreDebug.js.map +1 -1
- package/dist/cjs/useStoreDebug.native.js +55 -0
- package/dist/cjs/useStoreDebug.native.js.map +6 -0
- package/dist/esm/comparators.js +7 -9
- package/dist/esm/comparators.js.map +1 -1
- package/dist/esm/constants.js +2 -3
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/decorators.js +1 -2
- package/dist/esm/decorators.js.map +1 -1
- package/dist/esm/helpers.js +7 -18
- package/dist/esm/helpers.js.map +1 -1
- package/dist/esm/observe.js +29 -79
- package/dist/esm/observe.js.map +1 -1
- package/dist/esm/useStore.js +108 -303
- package/dist/esm/useStore.js.map +2 -2
- package/dist/esm/useStoreDebug.js +7 -20
- package/dist/esm/useStoreDebug.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/comparators.js
CHANGED
|
@@ -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:
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
|
29
|
-
return
|
|
30
|
-
if (typeof b
|
|
23
|
+
if (typeof a != typeof b)
|
|
24
|
+
return !1;
|
|
25
|
+
if (typeof b == "object") {
|
|
31
26
|
for (const key in b) {
|
|
32
|
-
const compare =
|
|
33
|
-
if (compare ? !compare(a[key], b[key]) : b[key] !== a[key])
|
|
34
|
-
return
|
|
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
|
|
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": "
|
|
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:
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
|
|
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:
|
|
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": "
|
|
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
|
package/dist/cjs/constants.js
CHANGED
|
@@ -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:
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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": "
|
|
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
|
package/dist/cjs/decorators.js
CHANGED
|
@@ -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:
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
|
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": "
|
|
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
|
package/dist/cjs/helpers.js
CHANGED
|
@@ -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:
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
|
|
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:
|
|
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}${
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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));
|
package/dist/cjs/helpers.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers.tsx"],
|
|
4
|
-
"mappings": "
|
|
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:
|
|
9
|
-
}
|
|
10
|
-
|
|
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
|
-
|
|
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
|
|
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,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
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
|
+
}
|