@tamagui/use-store 1.88.21 → 1.88.23
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/esm/comparators.native.js +2 -23
- package/dist/esm/comparators.native.js.map +1 -1
- package/dist/esm/configureUseStore.native.js +2 -24
- package/dist/esm/configureUseStore.native.js.map +1 -1
- package/dist/esm/constants.native.js +2 -24
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/decorators.native.js +2 -23
- package/dist/esm/decorators.native.js.map +1 -1
- package/dist/esm/helpers.native.js +4 -31
- package/dist/esm/helpers.native.js.map +1 -1
- package/dist/esm/index.native.js +10 -38
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/interfaces.native.js +0 -14
- package/dist/esm/interfaces.native.js.map +2 -2
- package/dist/esm/observe.native.js +12 -31
- package/dist/esm/observe.native.js.map +1 -1
- package/dist/esm/useStore.native.js +32 -56
- package/dist/esm/useStore.native.js.map +1 -1
- package/dist/esm/useStoreDebug.native.js +5 -38
- package/dist/esm/useStoreDebug.native.js.map +2 -2
- package/package.json +3 -3
|
@@ -1,23 +1,3 @@
|
|
|
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
1
|
const isEqualSubsetShallow = (a, b, opts) => {
|
|
22
2
|
var _a;
|
|
23
3
|
if (b == null || a == null)
|
|
@@ -34,8 +14,7 @@ const isEqualSubsetShallow = (a, b, opts) => {
|
|
|
34
14
|
}
|
|
35
15
|
return a === b;
|
|
36
16
|
};
|
|
37
|
-
|
|
38
|
-
0 && (module.exports = {
|
|
17
|
+
export {
|
|
39
18
|
isEqualSubsetShallow
|
|
40
|
-
}
|
|
19
|
+
};
|
|
41
20
|
//# sourceMappingURL=comparators.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/comparators.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAO,MAAM,uBAAuB,CAClC,GACA,GACA,SACG;AAJL;AAKE,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,WAAU,kCAAM,mBAAN,mBAAuB;AACvC,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
|
}
|
|
@@ -1,31 +1,9 @@
|
|
|
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
1
|
let configureOpts = {};
|
|
23
2
|
function configureUseStore(opts) {
|
|
24
3
|
configureOpts = opts;
|
|
25
4
|
}
|
|
26
|
-
|
|
27
|
-
0 && (module.exports = {
|
|
5
|
+
export {
|
|
28
6
|
configureOpts,
|
|
29
7
|
configureUseStore
|
|
30
|
-
}
|
|
8
|
+
};
|
|
31
9
|
//# sourceMappingURL=configureUseStore.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/configureUseStore.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAEO,IAAI,gBAAgC,CAAC;AAErC,SAAS,kBAAkB,MAAsB;AACtD,kBAAgB;AAClB;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,31 +1,9 @@
|
|
|
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
1
|
const UNWRAP_PROXY = Symbol(), defaultOptions = {
|
|
23
2
|
once: !1,
|
|
24
3
|
selector: void 0
|
|
25
4
|
};
|
|
26
|
-
|
|
27
|
-
0 && (module.exports = {
|
|
5
|
+
export {
|
|
28
6
|
UNWRAP_PROXY,
|
|
29
7
|
defaultOptions
|
|
30
|
-
}
|
|
8
|
+
};
|
|
31
9
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAO,MAAM,eAAe,OAAO,GAEtB,iBAAiB;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AACZ;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,30 +1,9 @@
|
|
|
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
1
|
function compare(comparator) {
|
|
22
2
|
return (target, propertyKey) => {
|
|
23
3
|
target._comparators = target._comparators || {}, target._comparators[propertyKey] = comparator;
|
|
24
4
|
};
|
|
25
5
|
}
|
|
26
|
-
|
|
27
|
-
0 && (module.exports = {
|
|
6
|
+
export {
|
|
28
7
|
compare
|
|
29
|
-
}
|
|
8
|
+
};
|
|
30
9
|
//# sourceMappingURL=decorators.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/decorators.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "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
|
}
|
|
@@ -1,32 +1,6 @@
|
|
|
1
|
-
|
|
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
|
-
get: () => get,
|
|
21
|
-
getStoreDebugInfo: () => getStoreDebugInfo,
|
|
22
|
-
getStoreDescriptors: () => getStoreDescriptors,
|
|
23
|
-
getStoreUid: () => getStoreUid,
|
|
24
|
-
simpleStr: () => simpleStr
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(helpers_exports);
|
|
27
|
-
var import_simple_hash = require("@tamagui/simple-hash");
|
|
1
|
+
import { simpleHash } from "@tamagui/simple-hash";
|
|
28
2
|
function getStoreUid(Constructor, props) {
|
|
29
|
-
return
|
|
3
|
+
return simpleHash(
|
|
30
4
|
`${Constructor}${props ? typeof props == "string" ? props : JSON.stringify(props) : ""}`,
|
|
31
5
|
"strict"
|
|
32
6
|
);
|
|
@@ -48,8 +22,7 @@ function simpleStr(arg) {
|
|
|
48
22
|
function getStoreDebugInfo(store) {
|
|
49
23
|
return store[UNWRAP_STORE_INFO] ?? cache.get(getStoreUid(store.constructor, store.props));
|
|
50
24
|
}
|
|
51
|
-
|
|
52
|
-
0 && (module.exports = {
|
|
25
|
+
export {
|
|
53
26
|
UNWRAP_STORE_INFO,
|
|
54
27
|
cache,
|
|
55
28
|
get,
|
|
@@ -57,5 +30,5 @@ function getStoreDebugInfo(store) {
|
|
|
57
30
|
getStoreDescriptors,
|
|
58
31
|
getStoreUid,
|
|
59
32
|
simpleStr
|
|
60
|
-
}
|
|
33
|
+
};
|
|
61
34
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAIpB,SAAS,YAAY,aAAkB,OAA+B;AAC3E,SAAO;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;AAEO,SAAS,UAAU,KAAU;AAClC,SAAI,QAAQ,IAAI,aAAa,gBACpB,OAAO,OAAQ,aAClB,OACA,OAAO,OAAQ,WACb,IAAI,GAAG,MACN,QAEC,OAAO,OAAQ,WACb,MACA,MAAM,QAAQ,GAAG,IACf,UACA,WAEP;AACT;AAGO,SAAS,kBAAkB,OAAY;AAC5C,SACE,MAAM,iBAAiB,KAAK,MAAM,IAAI,YAAY,MAAM,aAAa,MAAM,KAAK,CAAC;AAErF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,46 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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);
|
|
1
|
+
export * from "./useStore";
|
|
2
|
+
import { configureUseStore } from "./configureUseStore";
|
|
3
|
+
export * from "./interfaces";
|
|
4
|
+
export * from "./observe";
|
|
5
|
+
import { UNWRAP_PROXY } from "./constants";
|
|
6
|
+
export * from "./comparators";
|
|
7
|
+
export * from "./decorators";
|
|
30
8
|
class Store {
|
|
31
9
|
constructor(props) {
|
|
32
10
|
this.props = props;
|
|
33
11
|
}
|
|
34
12
|
}
|
|
35
|
-
|
|
36
|
-
0 && (module.exports = {
|
|
13
|
+
export {
|
|
37
14
|
Store,
|
|
38
15
|
UNWRAP_PROXY,
|
|
39
|
-
configureUseStore
|
|
40
|
-
|
|
41
|
-
...require("./interfaces"),
|
|
42
|
-
...require("./observe"),
|
|
43
|
-
...require("./comparators"),
|
|
44
|
-
...require("./decorators")
|
|
45
|
-
});
|
|
16
|
+
configureUseStore
|
|
17
|
+
};
|
|
46
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,cAAc;AACd,SAAS,yBAAyB;AAClC,cAAc;AACd,cAAc;AACd,SAAS,oBAAoB;AAC7B,cAAc;AACd,cAAc;AAGP,MAAM,MAAyC;AAAA,EACpD,YAAmB,OAAc;AAAd;AAAA,EAAe;AACpC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,15 +1 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
return to;
|
|
11
|
-
};
|
|
12
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
-
var interfaces_exports = {};
|
|
14
|
-
module.exports = __toCommonJS(interfaces_exports);
|
|
15
1
|
//# sourceMappingURL=interfaces.js.map
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 observe_exports = {};
|
|
17
|
-
__export(observe_exports, {
|
|
18
|
-
observe: () => observe,
|
|
19
|
-
useObserve: () => useObserve
|
|
20
|
-
});
|
|
21
|
-
module.exports = __toCommonJS(observe_exports);
|
|
22
|
-
var import_react = require("react"), import_comparators = require("./comparators"), import_constants = require("./constants"), import_useStore = require("./useStore");
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { isEqualSubsetShallow } from "./comparators";
|
|
3
|
+
import { UNWRAP_PROXY } from "./constants";
|
|
4
|
+
import { trackStoresAccess } from "./useStore";
|
|
23
5
|
const logUpdate = process.env.NODE_ENV === "development" ? (fn, stores, last, next) => {
|
|
24
6
|
const getStoreLogName = (store) => {
|
|
25
7
|
var _a;
|
|
26
|
-
return `${(store[
|
|
8
|
+
return `${(store[UNWRAP_PROXY] ?? store).constructor.name}${(_a = store.props) != null && _a.id ? `:${store.props.id}` : ""}`;
|
|
27
9
|
}, storeNames = stores.map(getStoreLogName).join(", "), name = `\u{1F311} \u25B6\uFE0F %c${fn.name} ${storeNames} () ${last} => ${next}`;
|
|
28
10
|
console.groupCollapsed(name, "color: tomato;"), console.groupCollapsed("trace >"), console.trace(), console.groupEnd(), console.info(" next", next), console.groupEnd();
|
|
29
11
|
} : null;
|
|
@@ -38,7 +20,7 @@ function observe(fn) {
|
|
|
38
20
|
disposeValue = next.value, process.env.NODE_ENV === "development" && logUpdate(fn, [...next.storeInfos], "(fn)", "(fn)");
|
|
39
21
|
return;
|
|
40
22
|
}
|
|
41
|
-
|
|
23
|
+
isEqualSubsetShallow(prev.storeInfos, next.storeInfos) && isEqualSubsetShallow(prev.value, next.value) || (process.env.NODE_ENV === "development" && logUpdate(fn, [...next.storeInfos], prev.value, next.value), prev = next, dispose(), dispose = subscribe());
|
|
42
24
|
});
|
|
43
25
|
};
|
|
44
26
|
let dispose = subscribe();
|
|
@@ -50,8 +32,8 @@ function observe(fn) {
|
|
|
50
32
|
};
|
|
51
33
|
}
|
|
52
34
|
function useObserve(fn) {
|
|
53
|
-
const [state, setState] =
|
|
54
|
-
return
|
|
35
|
+
const [state, setState] = useState(() => getObserverValueAndStoresAccessed(fn));
|
|
36
|
+
return useEffect(() => {
|
|
55
37
|
let dispose;
|
|
56
38
|
const unsub = subscribeToStores([...state.storeInfos], () => {
|
|
57
39
|
dispose == null || dispose();
|
|
@@ -60,7 +42,7 @@ function useObserve(fn) {
|
|
|
60
42
|
process.env.NODE_ENV === "development" && logUpdate(fn, nextStoreInfos, "(fn)", "(fn)"), dispose = next.value;
|
|
61
43
|
return;
|
|
62
44
|
}
|
|
63
|
-
setState((prev) =>
|
|
45
|
+
setState((prev) => isEqualSubsetShallow(prevStoreInfos, nextStoreInfos) && isEqualSubsetShallow(prev.value, next.value) ? prev : (process.env.NODE_ENV === "development" && logUpdate(fn, nextStoreInfos, prev.value, next.value), next));
|
|
64
46
|
});
|
|
65
47
|
return () => {
|
|
66
48
|
unsub(), dispose == null || dispose();
|
|
@@ -68,7 +50,7 @@ function useObserve(fn) {
|
|
|
68
50
|
}, [[...state.storeInfos].map((i) => i.uid).join(",")]), state.value;
|
|
69
51
|
}
|
|
70
52
|
function getObserverValueAndStoresAccessed(selector) {
|
|
71
|
-
const storeInfos = /* @__PURE__ */ new Set(), dispose =
|
|
53
|
+
const storeInfos = /* @__PURE__ */ new Set(), dispose = trackStoresAccess((storeInfo) => {
|
|
72
54
|
storeInfos.add(storeInfo);
|
|
73
55
|
}), value = selector();
|
|
74
56
|
return dispose(), {
|
|
@@ -98,9 +80,8 @@ function subscribeToStores(storeInfos, onUpdate) {
|
|
|
98
80
|
disposes.forEach((x) => x());
|
|
99
81
|
};
|
|
100
82
|
}
|
|
101
|
-
|
|
102
|
-
0 && (module.exports = {
|
|
83
|
+
export {
|
|
103
84
|
observe,
|
|
104
85
|
useObserve
|
|
105
|
-
}
|
|
86
|
+
};
|
|
106
87
|
//# sourceMappingURL=observe.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/observe.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,WAAW,gBAAgB;AAEpC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAElC,MAAM,YACJ,QAAQ,IAAI,aAAa,gBACrB,CAAC,IAAS,QAAe,MAAW,SAAc;AAChD,QAAM,kBAAkB,CAAC,UAAe;AAVhD;AAYU,WAAO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,kBAAkB;AAAA,MAEhC;AAAA,IACF,CAAC;AAAA,EACH;AAEA,aAAW,aAAa;AACtB,aAAS,KAAK,UAAU,UAAU,gCAAgC,CAAC;AAErE,SAAO,MAAM;AACX,aAAS,QAAQ,CAAC,MAAM,EAAE,CAAC;AAAA,EAC7B;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,40 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var useStore_exports = {};
|
|
17
|
-
__export(useStore_exports, {
|
|
18
|
-
allStores: () => allStores,
|
|
19
|
-
createStore: () => createStore,
|
|
20
|
-
createUseStore: () => createUseStore,
|
|
21
|
-
createUseStoreSelector: () => createUseStoreSelector,
|
|
22
|
-
getOrCreateStore: () => getOrCreateStore,
|
|
23
|
-
getStore: () => getStore,
|
|
24
|
-
getStoreInfo: () => getStoreInfo,
|
|
25
|
-
onCreateStore: () => onCreateStore,
|
|
26
|
-
setIsInReaction: () => setIsInReaction,
|
|
27
|
-
trackStoresAccess: () => trackStoresAccess,
|
|
28
|
-
useGlobalStore: () => useGlobalStore,
|
|
29
|
-
useGlobalStoreSelector: () => useGlobalStoreSelector,
|
|
30
|
-
useStore: () => useStore,
|
|
31
|
-
useStoreDebug: () => useStoreDebug,
|
|
32
|
-
useStoreSelector: () => useStoreSelector
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(useStore_exports);
|
|
35
|
-
var import_react = require("react"), import_comparators = require("./comparators"), import_configureUseStore = require("./configureUseStore"), import_constants = require("./constants"), import_helpers = require("./helpers"), import_useStoreDebug = require("./useStoreDebug");
|
|
1
|
+
import { useCallback, useRef, useSyncExternalStore } from "react";
|
|
2
|
+
import { isEqualSubsetShallow } from "./comparators";
|
|
3
|
+
import { configureOpts } from "./configureUseStore";
|
|
4
|
+
import { UNWRAP_PROXY, defaultOptions } from "./constants";
|
|
5
|
+
import {
|
|
6
|
+
UNWRAP_STORE_INFO,
|
|
7
|
+
cache,
|
|
8
|
+
getStoreDescriptors,
|
|
9
|
+
getStoreUid,
|
|
10
|
+
simpleStr
|
|
11
|
+
} from "./helpers";
|
|
12
|
+
import { DebugStores, shouldDebug, useCurrentComponent } from "./useStoreDebug";
|
|
36
13
|
const idFn = (_) => _;
|
|
37
|
-
function useStore(StoreKlass, props, options =
|
|
14
|
+
function useStore(StoreKlass, props, options = defaultOptions) {
|
|
38
15
|
const info = getOrCreateStoreInfo(StoreKlass, props, options);
|
|
39
16
|
return useStoreFromInfo(info, options.selector, options);
|
|
40
17
|
}
|
|
@@ -46,13 +23,13 @@ function createStore(StoreKlass, props, options) {
|
|
|
46
23
|
return (_a = getOrCreateStoreInfo(StoreKlass, props, options)) == null ? void 0 : _a.store;
|
|
47
24
|
}
|
|
48
25
|
function useGlobalStore(instance, debug) {
|
|
49
|
-
const store = instance[
|
|
26
|
+
const store = instance[UNWRAP_PROXY], uid = getStoreUid(store.constructor, store.props), info = cache.get(uid);
|
|
50
27
|
if (!info)
|
|
51
28
|
throw new Error("This store not created using createStore()");
|
|
52
29
|
return useStoreFromInfo(info, void 0, { debug });
|
|
53
30
|
}
|
|
54
31
|
function useGlobalStoreSelector(instance, selector, debug) {
|
|
55
|
-
const store = instance[
|
|
32
|
+
const store = instance[UNWRAP_PROXY], uid = getStoreUid(store.constructor, store.props), info = cache.get(uid);
|
|
56
33
|
if (!info)
|
|
57
34
|
throw new Error("This store not created using createStore()");
|
|
58
35
|
return useStoreFromInfo(info, selector, { debug });
|
|
@@ -97,14 +74,14 @@ function getOrCreateStoreInfo(StoreKlass, props, options, propsKeyCalculated) {
|
|
|
97
74
|
var _a;
|
|
98
75
|
if (!StoreKlass)
|
|
99
76
|
return null;
|
|
100
|
-
const uid =
|
|
101
|
-
if (!(options != null && options.avoidCache) &&
|
|
102
|
-
return
|
|
77
|
+
const uid = getStoreUid(StoreKlass, propsKeyCalculated ?? props);
|
|
78
|
+
if (!(options != null && options.avoidCache) && cache.has(uid))
|
|
79
|
+
return cache.get(uid);
|
|
103
80
|
if (options != null && options.refuseCreation)
|
|
104
81
|
throw new Error(`No store exists (${StoreKlass.name}) with props: ${props}`);
|
|
105
82
|
const storeInstance = new StoreKlass(props);
|
|
106
83
|
storeInstance.props = props;
|
|
107
|
-
const getters = {}, actions = {}, stateKeys = /* @__PURE__ */ new Set(), descriptors =
|
|
84
|
+
const getters = {}, actions = {}, stateKeys = /* @__PURE__ */ new Set(), descriptors = getStoreDescriptors(storeInstance);
|
|
108
85
|
for (const key in descriptors) {
|
|
109
86
|
const descriptor = descriptors[key];
|
|
110
87
|
typeof descriptor.value == "function" ? actions[key] = descriptor.value : typeof descriptor.get == "function" ? getters[key] = descriptor.get : key !== "props" && key[0] !== "_" && stateKeys.add(key);
|
|
@@ -142,7 +119,7 @@ function getOrCreateStoreInfo(StoreKlass, props, options, propsKeyCalculated) {
|
|
|
142
119
|
);
|
|
143
120
|
process.env.NODE_ENV === "development" && (allStores[StoreKlass.name + uid] = store), (_a = store.mount) == null || _a.call(store), storeInfo.store = store;
|
|
144
121
|
const result = storeInfo;
|
|
145
|
-
return
|
|
122
|
+
return cache.set(uid, result), onCreateListeners.forEach((cb) => cb(result)), result;
|
|
146
123
|
}
|
|
147
124
|
const allStores = {};
|
|
148
125
|
process.env.NODE_ENV === "development" && (globalThis.Store || (globalThis.Store = allStores));
|
|
@@ -159,14 +136,14 @@ const setIsInReaction = (val) => {
|
|
|
159
136
|
isInReaction = val;
|
|
160
137
|
};
|
|
161
138
|
function useStoreFromInfo(info, userSelector, options) {
|
|
162
|
-
const store = info == null ? void 0 : info.store, internal =
|
|
139
|
+
const store = info == null ? void 0 : info.store, internal = useRef(), component = useCurrentComponent();
|
|
163
140
|
internal.current || (internal.current = {
|
|
164
141
|
component,
|
|
165
142
|
tracked: /* @__PURE__ */ new Set(),
|
|
166
143
|
last: null,
|
|
167
144
|
lastKeys: null
|
|
168
145
|
});
|
|
169
|
-
const curInternal = internal.current, shouldPrintDebug = options == null ? void 0 : options.debug, getSnapshot =
|
|
146
|
+
const curInternal = internal.current, shouldPrintDebug = options == null ? void 0 : options.debug, getSnapshot = useCallback(() => {
|
|
170
147
|
if (!info || !store)
|
|
171
148
|
return;
|
|
172
149
|
const curInternal2 = internal.current, isTracking = curInternal2.tracked.size, keys = [...isTracking ? curInternal2.tracked : info.stateKeys], nextKeys = `${info.version}${keys.join("")}${userSelector || ""}`, lastKeys = curInternal2.lastKeys;
|
|
@@ -177,7 +154,7 @@ function useStoreFromInfo(info, userSelector, options) {
|
|
|
177
154
|
info.disableTracking = !0;
|
|
178
155
|
const last = curInternal2.last;
|
|
179
156
|
userSelector ? snap = userSelector(store) : snap = selectKeys(store, keys), info.disableTracking = !1;
|
|
180
|
-
const isUnchanged = !userSelector && !isTracking && last || typeof last < "u" &&
|
|
157
|
+
const isUnchanged = !userSelector && !isTracking && last || typeof last < "u" && isEqualSubsetShallow(last, snap, {
|
|
181
158
|
keyComparators: info.keyComparators
|
|
182
159
|
});
|
|
183
160
|
return shouldPrintDebug && console.info("\u{1F311} getSnapshot", {
|
|
@@ -193,7 +170,7 @@ function useStoreFromInfo(info, userSelector, options) {
|
|
|
193
170
|
nextKeys,
|
|
194
171
|
lastKeys
|
|
195
172
|
}), isUnchanged ? last : (curInternal2.last = snap, snap);
|
|
196
|
-
}, [store]), state =
|
|
173
|
+
}, [store]), state = useSyncExternalStore((info == null ? void 0 : info.subscribe) || idFn, getSnapshot, getSnapshot);
|
|
197
174
|
return !info || !store || !state || userSelector ? state : new Proxy(store, {
|
|
198
175
|
get(target, key) {
|
|
199
176
|
const curVal = Reflect.get(target, key);
|
|
@@ -207,7 +184,7 @@ function useStoreFromInfo(info, userSelector, options) {
|
|
|
207
184
|
let setters = /* @__PURE__ */ new Set();
|
|
208
185
|
const logStack = /* @__PURE__ */ new Set();
|
|
209
186
|
function createProxiedStore(storeInfo) {
|
|
210
|
-
const { actions, storeInstance, getters, gettersState } = storeInfo, { getCache, curGetKeys, depsToGetter } = gettersState, constr = storeInstance.constructor, shouldDebug2 = storeInfo.debug ??
|
|
187
|
+
const { actions, storeInstance, getters, gettersState } = storeInfo, { getCache, curGetKeys, depsToGetter } = gettersState, constr = storeInstance.constructor, shouldDebug2 = storeInfo.debug ?? DebugStores.has(constr);
|
|
211
188
|
let didSet = !1;
|
|
212
189
|
const wrappedActions = {};
|
|
213
190
|
for (const key in actions) {
|
|
@@ -232,7 +209,7 @@ function createProxiedStore(storeInfo) {
|
|
|
232
209
|
wrappedActions[key] = new Proxy(ogAction, {
|
|
233
210
|
apply(target, thisArg, args) {
|
|
234
211
|
const isDebugging = shouldDebug2 || storeInfo.debug;
|
|
235
|
-
if (!(process.env.LOG_LEVEL !== "0" && (isDebugging ||
|
|
212
|
+
if (!(process.env.LOG_LEVEL !== "0" && (isDebugging || configureOpts.logLevel !== "error")))
|
|
236
213
|
return Reflect.apply(target, thisArg, args);
|
|
237
214
|
setters = /* @__PURE__ */ new Set();
|
|
238
215
|
const curSetters = setters, isTopLevelLogger = logStack.size == 0, logs = /* @__PURE__ */ new Set();
|
|
@@ -245,7 +222,7 @@ function createProxiedStore(storeInfo) {
|
|
|
245
222
|
throw console.error("Error", err), err;
|
|
246
223
|
} finally {
|
|
247
224
|
logStack.add("end");
|
|
248
|
-
const name = constr.name, color = strColor2(name), simpleArgs = args.map(
|
|
225
|
+
const name = constr.name, color = strColor2(name), simpleArgs = args.map(simpleStr);
|
|
249
226
|
if (logs.add([
|
|
250
227
|
`%c \u{1F311} ${id} ${name.padStart(
|
|
251
228
|
isTopLevelLogger ? 8 : 4
|
|
@@ -293,9 +270,9 @@ function createProxiedStore(storeInfo) {
|
|
|
293
270
|
return wrappedActions[key];
|
|
294
271
|
if (key in passThroughKeys)
|
|
295
272
|
return Reflect.get(storeInstance, key);
|
|
296
|
-
if (key ===
|
|
273
|
+
if (key === UNWRAP_PROXY)
|
|
297
274
|
return storeInstance;
|
|
298
|
-
if (key ===
|
|
275
|
+
if (key === UNWRAP_STORE_INFO)
|
|
299
276
|
return storeInfo;
|
|
300
277
|
if (storeAccessTrackers.size && storeAccessTrackers.forEach((cb) => cb(storeInfo)), typeof key != "string")
|
|
301
278
|
return Reflect.get(storeInstance, key);
|
|
@@ -342,11 +319,10 @@ const passThroughKeys = {
|
|
|
342
319
|
function getShouldDebug(storeInfo) {
|
|
343
320
|
const info = { storeInstance: storeInfo.store };
|
|
344
321
|
return [...storeInfo.trackers].some(
|
|
345
|
-
(tracker) => tracker.component &&
|
|
322
|
+
(tracker) => tracker.component && shouldDebug(tracker.component, info)
|
|
346
323
|
);
|
|
347
324
|
}
|
|
348
|
-
|
|
349
|
-
0 && (module.exports = {
|
|
325
|
+
export {
|
|
350
326
|
allStores,
|
|
351
327
|
createStore,
|
|
352
328
|
createUseStore,
|
|
@@ -362,5 +338,5 @@ function getShouldDebug(storeInfo) {
|
|
|
362
338
|
useStore,
|
|
363
339
|
useStoreDebug,
|
|
364
340
|
useStoreSelector
|
|
365
|
-
}
|
|
341
|
+
};
|
|
366
342
|
//# sourceMappingURL=useStore.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useStore.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa,QAAQ,4BAA4B;AAE1D,SAAS,4BAA4B;AACrC,SAAS,qBAAqB;AAC9B,SAAS,cAAc,sBAAsB;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,aAAa,aAAa,2BAA2B;AAE9D,MAAM,OAAO,CAAC,MAAM;AAGb,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Aa,iBAAiBA,gBAC5C,QAAQ,KAAK,UAAU,EAAE,KAAK,MAAM,CAAC,IAIpC,iBAEH,eAAe,IACf,iBAAiB,MAAM;AACrB,kBAAU,cAAc,GACxB,eAAe;AAAA,MACjB,CAAC,KAGE;AAAA,IACT;AAAA,EACF,CAAC;AAED,WAAS,iBAAiB,QAAgB;AACxC,UAAM,gBAAgB,aAAa,IAAI,MAAM;AAG7C,QAFA,SAAS,OAAO,MAAM,GAElB,EAAC;AAGL,iBAAW,MAAM;AACf,iBAAS,OAAO,EAAE,GACd,aAAa,IAAI,EAAE,KACrB,iBAAiB,EAAE;AAAA,EAGzB;AAEA,SAAO;AACT;AAEA,MAAM,oBACJ,QAAQ,IAAI,UACR,CAAC,OAAiB,GAAG;AAG3B,IAAI,UAAU;AAEd,MAAM,kBAAkB;AAAA,EACtB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,iBAAiB;AACnB;AASA,SAAS,eAAe,WAAsB;AAC5C,QAAM,OAAO,EAAE,eAAe,UAAU,MAAM;AAE9C,SAAO,CAAC,GADS,UAAU,QACR,EAAE;AAAA,IACnB,CAAC,YAAY,QAAQ,aAAa,YAAY,QAAQ,WAAW,IAAI;AAAA,EACvE;AACF;",
|
|
5
5
|
"names": ["curInternal", "shouldDebug", "hashCode", "strColor", "key", "name"]
|
|
6
6
|
}
|
|
@@ -1,42 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
-
mod
|
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
-
var useStoreDebug_exports = {};
|
|
25
|
-
__export(useStoreDebug_exports, {
|
|
26
|
-
DebugComponents: () => DebugComponents,
|
|
27
|
-
DebugStores: () => DebugStores,
|
|
28
|
-
shouldDebug: () => shouldDebug,
|
|
29
|
-
useCurrentComponent: () => useCurrentComponent,
|
|
30
|
-
useDebugStoreComponent: () => useDebugStoreComponent
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(useStoreDebug_exports);
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
const { ReactCurrentOwner } = import_react.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, useCurrentComponent = () => ReactCurrentOwner && ReactCurrentOwner.current && ReactCurrentOwner.current.elementType ? ReactCurrentOwner.current.elementType : {};
|
|
1
|
+
import React, { useLayoutEffect } from "react";
|
|
2
|
+
const { ReactCurrentOwner } = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, useCurrentComponent = () => ReactCurrentOwner && ReactCurrentOwner.current && ReactCurrentOwner.current.elementType ? ReactCurrentOwner.current.elementType : {};
|
|
35
3
|
function useDebugStoreComponent(StoreCons) {
|
|
36
4
|
const cmp = useCurrentComponent();
|
|
37
5
|
DebugStores.add(StoreCons), DebugComponents.has(cmp) || DebugComponents.set(cmp, /* @__PURE__ */ new Set());
|
|
38
6
|
const stores = DebugComponents.get(cmp);
|
|
39
|
-
stores.add(StoreCons),
|
|
7
|
+
stores.add(StoreCons), useLayoutEffect(() => () => {
|
|
40
8
|
DebugStores.delete(StoreCons), stores.delete(StoreCons);
|
|
41
9
|
}, []);
|
|
42
10
|
}
|
|
@@ -45,12 +13,11 @@ const shouldDebug = (component, info) => {
|
|
|
45
13
|
const StoreCons = (_a = info.storeInstance) == null ? void 0 : _a.constructor;
|
|
46
14
|
return (_b = DebugComponents.get(component)) == null ? void 0 : _b.has(StoreCons);
|
|
47
15
|
}, DebugComponents = /* @__PURE__ */ new Map(), DebugStores = /* @__PURE__ */ new Set();
|
|
48
|
-
|
|
49
|
-
0 && (module.exports = {
|
|
16
|
+
export {
|
|
50
17
|
DebugComponents,
|
|
51
18
|
DebugStores,
|
|
52
19
|
shouldDebug,
|
|
53
20
|
useCurrentComponent,
|
|
54
21
|
useDebugStoreComponent
|
|
55
|
-
}
|
|
22
|
+
};
|
|
56
23
|
//# sourceMappingURL=useStoreDebug.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useStoreDebug.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
4
|
+
"mappings": "AAAA,OAAO,SAAS,uBAAuB;AAIvC,MAAM,EAAE,kBAAkB,IAAK,MAC5B,oDACU,sBAAsB,MAC1B,qBACL,kBAAkB,WAClB,kBAAkB,QAAQ,cACxB,kBAAkB,QAAQ,cAC1B,CAAC;AAGA,SAAS,uBAAuB,WAAgB;AACrD,QAAM,MAAM,oBAAoB;AAGhC,cAAY,IAAI,SAAS,GACpB,gBAAgB,IAAI,GAAG,KAC1B,gBAAgB,IAAI,KAAK,oBAAI,IAAI,CAAC;AAEpC,QAAM,SAAS,gBAAgB,IAAI,GAAG;AACtC,SAAO,IAAI,SAAS,GAEpB,gBAAgB,MACP,MAAM;AACX,gBAAY,OAAO,SAAS,GAC5B,OAAO,OAAO,SAAS;AAAA,EACzB,GACC,CAAC,CAAC;AACP;AAEO,MAAM,cAAc,CAAC,WAAgB,SAA2C;AAjCvF;AAkCE,QAAM,aAAY,UAAK,kBAAL,mBAAoB;AACtC,UAAO,qBAAgB,IAAI,SAAS,MAA7B,mBAAgC,IAAI;AAC7C,GAEa,kBAAkB,oBAAI,IAAmB,GACzC,cAAc,oBAAI,IAAS;",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-store",
|
|
3
|
-
"version": "1.88.
|
|
3
|
+
"version": "1.88.23",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@tamagui/simple-hash": "1.88.
|
|
31
|
+
"@tamagui/simple-hash": "1.88.23"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tamagui/build": "1.88.
|
|
34
|
+
"@tamagui/build": "1.88.23",
|
|
35
35
|
"@testing-library/react": "^14.0.0",
|
|
36
36
|
"react": "^18.2.0",
|
|
37
37
|
"vitest": "^0.34.3"
|