@e1011/es-kit 1.0.90 → 1.0.94
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/hooks/esm/index.css +52 -52
- package/dist/hooks/index.css +52 -52
- package/dist/lib/cjs/src/core/utils/appState/store/store.vanillajs.js +1 -1
- package/dist/lib/cjs/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/appState/store/useStore.react.js.map +1 -1
- package/dist/lib/esm/src/core/utils/appState/store/store.vanillajs.js +1 -1
- package/dist/lib/esm/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/lib/esm/src/core/utils/appState/store/useStore.react.js.map +1 -1
- package/dist/lib/src/core/utils/appState/store/store.vanillajs.js +3 -2
- package/dist/lib/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/lib/src/core/utils/appState/store/useStore.react.js +5 -1
- package/dist/lib/src/core/utils/appState/store/useStore.react.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/core/utils/appState/store/store.vanillajs.d.ts +1 -1
- package/dist/types/src/core/utils/appState/store/store.vanillajs.d.ts.map +1 -1
- package/dist/types/src/core/utils/appState/store/useStore.react.d.ts +8 -5
- package/dist/types/src/core/utils/appState/store/useStore.react.d.ts.map +1 -1
- package/dist/utils/esm/index.css +52 -52
- package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.js +1 -1
- package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/utils/esm/src/core/utils/appState/store/useStore.react.js.map +1 -1
- package/dist/utils/index.css +52 -52
- package/dist/utils/src/core/utils/appState/store/store.vanillajs.js +1 -1
- package/dist/utils/src/core/utils/appState/store/store.vanillajs.js.map +1 -1
- package/dist/utils/src/core/utils/appState/store/useStore.react.js.map +1 -1
- package/package.json +1 -1
package/dist/hooks/esm/index.css
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
2
|
+
transform-origin: 0% 0%;
|
|
3
|
+
opacity: 0;
|
|
4
|
+
overflow: clip;
|
|
5
|
+
}
|
|
6
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
|
|
7
|
+
transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
|
|
8
|
+
will-change: opacity, height, max-height;
|
|
9
|
+
}
|
|
10
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
|
|
11
|
+
height: 0;
|
|
12
|
+
max-height: 0;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
|
|
16
|
+
height: var(--prop-value);
|
|
17
|
+
max-height: var(--prop-value);
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
|
|
21
|
+
transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
|
|
22
|
+
will-change: opacity, width, max-width;
|
|
23
|
+
}
|
|
24
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
|
|
25
|
+
width: 0;
|
|
26
|
+
max-width: 0;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
}
|
|
29
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
|
|
30
|
+
width: var(--prop-value);
|
|
31
|
+
max-width: var(--prop-value);
|
|
32
|
+
opacity: 1;
|
|
33
|
+
}
|
|
1
34
|
.icon-module_icon-base-parent__nOMvW {
|
|
2
35
|
line-height: 1px !important;
|
|
3
36
|
}
|
|
@@ -28,6 +61,25 @@
|
|
|
28
61
|
width: var(--height);
|
|
29
62
|
height: var(--width);
|
|
30
63
|
}
|
|
64
|
+
.divider-module_divider-line__6CesR {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: block;
|
|
67
|
+
transition: opacity, width, height 250ms ease-in-out;
|
|
68
|
+
background-color: var(--color);
|
|
69
|
+
opacity: var(--opacity);
|
|
70
|
+
}
|
|
71
|
+
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
72
|
+
height: var(--length);
|
|
73
|
+
left: var(--left);
|
|
74
|
+
width: var(--width);
|
|
75
|
+
margin: var(--margin);
|
|
76
|
+
}
|
|
77
|
+
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
78
|
+
width: var(--length);
|
|
79
|
+
left: var(--left);
|
|
80
|
+
height: var(--height);
|
|
81
|
+
margin: var(--margin);
|
|
82
|
+
}
|
|
31
83
|
.fbox-module_flexible-box__rLJ93 {
|
|
32
84
|
display: flex;
|
|
33
85
|
position: relative;
|
|
@@ -51,56 +103,4 @@
|
|
|
51
103
|
min-width: 0;
|
|
52
104
|
min-height: 0;
|
|
53
105
|
border-radius: initial;
|
|
54
|
-
}
|
|
55
|
-
.divider-module_divider-line__6CesR {
|
|
56
|
-
position: relative;
|
|
57
|
-
display: block;
|
|
58
|
-
transition: opacity, width, height 250ms ease-in-out;
|
|
59
|
-
background-color: var(--color);
|
|
60
|
-
opacity: var(--opacity);
|
|
61
|
-
}
|
|
62
|
-
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
63
|
-
height: var(--length);
|
|
64
|
-
left: var(--left);
|
|
65
|
-
width: var(--width);
|
|
66
|
-
margin: var(--margin);
|
|
67
|
-
}
|
|
68
|
-
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
69
|
-
width: var(--length);
|
|
70
|
-
left: var(--left);
|
|
71
|
-
height: var(--height);
|
|
72
|
-
margin: var(--margin);
|
|
73
|
-
}
|
|
74
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
75
|
-
transform-origin: 0% 0%;
|
|
76
|
-
opacity: 0;
|
|
77
|
-
overflow: clip;
|
|
78
|
-
}
|
|
79
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
|
|
80
|
-
transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
|
|
81
|
-
will-change: opacity, height, max-height;
|
|
82
|
-
}
|
|
83
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
|
|
84
|
-
height: 0;
|
|
85
|
-
max-height: 0;
|
|
86
|
-
opacity: 0;
|
|
87
|
-
}
|
|
88
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
|
|
89
|
-
height: var(--prop-value);
|
|
90
|
-
max-height: var(--prop-value);
|
|
91
|
-
opacity: 1;
|
|
92
|
-
}
|
|
93
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
|
|
94
|
-
transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
|
|
95
|
-
will-change: opacity, width, max-width;
|
|
96
|
-
}
|
|
97
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
|
|
98
|
-
width: 0;
|
|
99
|
-
max-width: 0;
|
|
100
|
-
opacity: 0;
|
|
101
|
-
}
|
|
102
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
|
|
103
|
-
width: var(--prop-value);
|
|
104
|
-
max-width: var(--prop-value);
|
|
105
|
-
opacity: 1;
|
|
106
106
|
}
|
package/dist/hooks/index.css
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
2
|
+
transform-origin: 0% 0%;
|
|
3
|
+
opacity: 0;
|
|
4
|
+
overflow: clip;
|
|
5
|
+
}
|
|
6
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
|
|
7
|
+
transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
|
|
8
|
+
will-change: opacity, height, max-height;
|
|
9
|
+
}
|
|
10
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
|
|
11
|
+
height: 0;
|
|
12
|
+
max-height: 0;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
|
|
16
|
+
height: var(--prop-value);
|
|
17
|
+
max-height: var(--prop-value);
|
|
18
|
+
opacity: 1;
|
|
19
|
+
}
|
|
20
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
|
|
21
|
+
transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
|
|
22
|
+
will-change: opacity, width, max-width;
|
|
23
|
+
}
|
|
24
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
|
|
25
|
+
width: 0;
|
|
26
|
+
max-width: 0;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
}
|
|
29
|
+
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
|
|
30
|
+
width: var(--prop-value);
|
|
31
|
+
max-width: var(--prop-value);
|
|
32
|
+
opacity: 1;
|
|
33
|
+
}
|
|
1
34
|
.icon-module_icon-base-parent__nOMvW {
|
|
2
35
|
line-height: 1px !important;
|
|
3
36
|
}
|
|
@@ -28,6 +61,25 @@
|
|
|
28
61
|
width: var(--height);
|
|
29
62
|
height: var(--width);
|
|
30
63
|
}
|
|
64
|
+
.divider-module_divider-line__6CesR {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: block;
|
|
67
|
+
transition: opacity, width, height 250ms ease-in-out;
|
|
68
|
+
background-color: var(--color);
|
|
69
|
+
opacity: var(--opacity);
|
|
70
|
+
}
|
|
71
|
+
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
72
|
+
height: var(--length);
|
|
73
|
+
left: var(--left);
|
|
74
|
+
width: var(--width);
|
|
75
|
+
margin: var(--margin);
|
|
76
|
+
}
|
|
77
|
+
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
78
|
+
width: var(--length);
|
|
79
|
+
left: var(--left);
|
|
80
|
+
height: var(--height);
|
|
81
|
+
margin: var(--margin);
|
|
82
|
+
}
|
|
31
83
|
.fbox-module_flexible-box__rLJ93 {
|
|
32
84
|
display: flex;
|
|
33
85
|
position: relative;
|
|
@@ -51,56 +103,4 @@
|
|
|
51
103
|
min-width: 0;
|
|
52
104
|
min-height: 0;
|
|
53
105
|
border-radius: initial;
|
|
54
|
-
}
|
|
55
|
-
.divider-module_divider-line__6CesR {
|
|
56
|
-
position: relative;
|
|
57
|
-
display: block;
|
|
58
|
-
transition: opacity, width, height 250ms ease-in-out;
|
|
59
|
-
background-color: var(--color);
|
|
60
|
-
opacity: var(--opacity);
|
|
61
|
-
}
|
|
62
|
-
.divider-module_divider-line__6CesR.divider-module_vertical__qSVWD {
|
|
63
|
-
height: var(--length);
|
|
64
|
-
left: var(--left);
|
|
65
|
-
width: var(--width);
|
|
66
|
-
margin: var(--margin);
|
|
67
|
-
}
|
|
68
|
-
.divider-module_divider-line__6CesR.divider-module_horizontal__Gz-Oj {
|
|
69
|
-
width: var(--length);
|
|
70
|
-
left: var(--left);
|
|
71
|
-
height: var(--height);
|
|
72
|
-
margin: var(--margin);
|
|
73
|
-
}
|
|
74
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm {
|
|
75
|
-
transform-origin: 0% 0%;
|
|
76
|
-
opacity: 0;
|
|
77
|
-
overflow: clip;
|
|
78
|
-
}
|
|
79
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN {
|
|
80
|
-
transition: opacity 0.2s ease-in-out, height 0.2s ease-in-out, max-height 0.2s ease-in-out;
|
|
81
|
-
will-change: opacity, height, max-height;
|
|
82
|
-
}
|
|
83
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_collapsed__q8fs8 {
|
|
84
|
-
height: 0;
|
|
85
|
-
max-height: 0;
|
|
86
|
-
opacity: 0;
|
|
87
|
-
}
|
|
88
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_vertical__w7MVN.CollapsibleContainer-module_expanded__O6Vh8 {
|
|
89
|
-
height: var(--prop-value);
|
|
90
|
-
max-height: var(--prop-value);
|
|
91
|
-
opacity: 1;
|
|
92
|
-
}
|
|
93
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI- {
|
|
94
|
-
transition: opacity 0.2s ease-in-out, width 0.2s ease-in-out, max-width 0.2s ease-in-out;
|
|
95
|
-
will-change: opacity, width, max-width;
|
|
96
|
-
}
|
|
97
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_collapsed__q8fs8 {
|
|
98
|
-
width: 0;
|
|
99
|
-
max-width: 0;
|
|
100
|
-
opacity: 0;
|
|
101
|
-
}
|
|
102
|
-
.CollapsibleContainer-module_collapsible-container__u0Jmm.CollapsibleContainer-module_horizontal__QJWI-.CollapsibleContainer-module_expanded__O6Vh8 {
|
|
103
|
-
width: var(--prop-value);
|
|
104
|
-
max-width: var(--prop-value);
|
|
105
|
-
opacity: 1;
|
|
106
106
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../node_modules/core-js/modules/es.array.iterator.js"),require("../../../../../node_modules/core-js/modules/es.object.to-string.js"),require("../../../../../node_modules/core-js/modules/es.set.constructor.js"),require("../../../../../node_modules/core-js/modules/es.string.iterator.js"),require("../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js"),require("../../../../../node_modules/core-js/modules/es.object.entries.js"),require("../../../../../node_modules/core-js/modules/es.array.reduce.js");exports.createStore=function(r,t){var o,n=r,s=new Set,u=function(){var r=e.asyncToGenerator(e.regeneratorRuntime().mark((function r(t){var o,u,c
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js");require("../../../../../node_modules/core-js/modules/es.array.iterator.js"),require("../../../../../node_modules/core-js/modules/es.object.to-string.js"),require("../../../../../node_modules/core-js/modules/es.set.constructor.js"),require("../../../../../node_modules/core-js/modules/es.string.iterator.js"),require("../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js"),require("../../../../../node_modules/core-js/modules/es.object.entries.js"),require("../../../../../node_modules/core-js/modules/es.array.reduce.js");exports.createStore=function(r,t){var o,n=r,s=new Set,u=function(){return n},a=function(){var r=e.asyncToGenerator(e.regeneratorRuntime().mark((function r(t){var o,u,a,c;return e.regeneratorRuntime().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=t,o=e.createForOfIteratorHelper(s),r.prev=2,o.s();case 4:if((u=o.n()).done){r.next=11;break}return a=u.value,c=null==a?void 0:a.selector,r.next=9,a(c?c(n):n);case 9:r.next=4;break;case 11:r.next=16;break;case 13:r.prev=13,r.t0=r.catch(2),o.e(r.t0);case 16:return r.prev=16,o.f(),r.finish(16);case 19:case"end":return r.stop()}}),r,null,[[2,13,16,19]])})));return function(e){return r.apply(this,arguments)}}(),c={getState:u,setState:a,subscribe:function(e){return s.add(e),function(){return s.delete(e)}}},i=t?null===(o=Object.entries(t))||void 0===o?void 0:o.reduce((function(r,t){var o=e.slicedToArray(t,2),n=o[0],s=o[1];return e.objectSpread2(e.objectSpread2({},r),{},e.defineProperty({},n,e.asyncToGenerator(e.regeneratorRuntime().mark((function r(){return e.regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",s(u,a));case 1:case"end":return e.stop()}}),r)})))))}),{}):null;return e.objectSpread2(e.objectSpread2({},c),i?{actions:e.objectSpread2({},i)}:{})};
|
|
2
2
|
//# sourceMappingURL=store.vanillajs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\nexport type Selector<T> = (state: Partial<T>) => Partial<T>;\n\nexport type Listener<T> = {\n selector?: Selector<T>\n} & ListenerCallBack<T>\n\nexport type Store<T> = {\n getState: () => Partial<T>\n setState: (state: Partial<T>) => void\n subscribe: (listener: Listener<T>) => () => void\n} & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\nexport type ActionHandler<T> = (
|
|
1
|
+
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\nexport type Selector<T> = (state: Partial<T>) => Partial<T>;\n\nexport type Listener<T> = {\n selector?: Selector<T>\n} & ListenerCallBack<T>\n\nexport type Store<T> = {\n getState: () => Partial<T>\n setState: (state: Partial<T>) => void\n subscribe: (listener: Listener<T>) => () => void\n} & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\n\nexport type ActionHandler<T> = (\n getState: Store<T>['getState'],\n setState: Store<T>['setState']\n) => void | Partial<T> | Promise<void | Partial<T>>\n\n\nexport type ActionHandlerCaller = () => void\n\n\nexport const createStore = <T>(initialState: Partial<T>, actions?: Record<string, ActionHandler<T>>): Store<T> => {\n let currentState: Partial<T> = initialState\n const listeners = new Set<Listener<T>>()\n\n\n const getState = () => currentState\n\n const setState = async (newState: Partial<T>) => {\n currentState = newState\n\n // eslint-disable-next-line no-restricted-syntax\n for (const listener of listeners) {\n // has Listener selector?\n const selector: Selector<T> | undefined = listener?.selector\n\n // TODO compare selected value to the previous values of that listener/selector pair\n // if listener.previousValue === selector(currentState) no call\n // else listener.previousValue = selector(currentState) and call\n // l1 cache, weak references?\n\n // TODO parallelize await\n // eslint-disable-next-line no-await-in-loop\n await listener(selector ? selector(currentState) : currentState)\n }\n }\n\n const storeBaseicApi: Store<T> = {\n getState,\n setState,\n subscribe: (listener: Listener<T>) => {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n }\n\n\n const resolvedActions: Record<string, ActionHandlerCaller> | null | undefined\n = actions ? Object.entries(actions)?.reduce(\n (\n aggregator: Record<string, ActionHandlerCaller>,\n [actionName, actionHandler]: [string, ActionHandler<T>],\n ) => ({\n ...aggregator,\n [actionName]: async() => actionHandler(getState, setState),\n }),\n {},\n ) : null\n\n const storeCombinedWithActions = {\n ...storeBaseicApi,\n ...(resolvedActions ? { actions: { ...resolvedActions } } : {}),\n }\n\n return storeCombinedWithActions\n}\n"],"names":["initialState","actions","_Object$entries","currentState","listeners","Set","getState","setState","_ref","_asyncToGenerator","_regeneratorRuntime","regeneratorRuntime","mark","_callee","newState","_iterator","_step","_listener","selector","wrap","_context","prev","next","_createForOfIteratorHelper","s","n","done","listener","value","t0","e","f","finish","stop","_x","apply","this","arguments","storeBaseicApi","subscribe","add","delete","resolvedActions","Object","entries","reduce","aggregator","_ref2","_ref3","_slicedToArray","actionName","actionHandler","_objectSpread","objectSpread2","_defineProperty","_callee2","_context2","abrupt"],"mappings":"+rBA0B2B,SAAIA,EAA0BC,GAAyD,IAAAC,EAC5GC,EAA2BH,EACzBI,EAAY,IAAIC,IAGhBC,EAAW,WAAH,OAASH,CAAY,EAE7BI,EAAQ,WAAA,IAAAC,EAAAC,EAAAA,iBAAAC,EAAAC,qBAAAC,MAAG,SAAAC,EAAOC,GAAoB,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAR,EAAAC,qBAAAQ,MAAA,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAC1CnB,EAAeW,EAEfC,EAAAQ,EAAAA,0BACuBnB,GAASgB,EAAAC,KAAA,EAAAN,EAAAS,IAAA,KAAA,EAAA,IAAAR,EAAAD,EAAAU,KAAAC,KAAA,CAAAN,EAAAE,KAAA,GAAA,KAAA,CAU9B,OAVSK,EAAQX,EAAAY,MAEXV,EAAoCS,eAAAA,EAAUT,SAQpDE,EAAAE,KAAA,EACMK,EAAST,EAAWA,EAASf,GAAgBA,GAAa,KAAA,EAAAiB,EAAAE,KAAA,EAAA,MAAA,KAAA,GAAAF,EAAAE,KAAA,GAAA,MAAA,KAAA,GAAAF,EAAAC,KAAA,GAAAD,EAAAS,GAAAT,EAAA,MAAA,GAAAL,EAAAe,EAAAV,EAAAS,IAAA,KAAA,GAAA,OAAAT,EAAAC,KAAA,GAAAN,EAAAgB,IAAAX,EAAAY,OAAA,IAAA,KAAA,GAAA,IAAA,MAAA,OAAAZ,EAAAa,OAAA,GAAApB,EAAA,KAAA,CAAA,CAAA,EAAA,GAAA,GAAA,KAEnE,KAAA,OAjBKN,SAAQ2B,GAAA,OAAA1B,EAAA2B,MAAAC,KAAAC,UAAA,EAAA,GAmBRC,EAA2B,CAC/BhC,SAAAA,EACAC,SAAAA,EACAgC,UAAW,SAACZ,GAEV,OADAvB,EAAUoC,IAAIb,GACP,WAAA,OAAMvB,EAAUqC,OAAOd,EAAS,CACzC,GAIIe,EACFzC,EAAiCC,QAA1BA,EAAGyC,OAAOC,QAAQ3C,cAAQC,SAAvBA,EAAyB2C,QACnC,SACEC,EAA+CC,GAAA,IAAAC,EAAAC,EAAAA,cAAAF,EAAA,GAC9CG,EAAUF,EAAA,GAAEG,EAAaH,EAAA,GAAA,OAAAI,EAAAC,cAAAD,EAAAC,cAEvBP,CAAAA,EAAAA,MAAUQ,EAAAA,eAAA,CAAA,EACZJ,EAAUzC,EAAAA,iBAAAC,EAAAA,qBAAAE,MAAG,SAAA2C,IAAA,OAAA7C,EAAAC,qBAAAQ,MAAA,SAAAqC,GAAA,cAAAA,EAAAnC,KAAAmC,EAAAlC,MAAA,KAAA,EAAA,OAAAkC,EAAAC,OAAA,SAAWN,EAAc7C,EAAUC,IAAS,KAAA,EAAA,IAAA,MAAA,OAAAiD,EAAAvB,OAAA,GAAAsB,EAAA,MAAA,GAE5D,CAAA,GACE,KAON,OAL8BH,EAAAA,cAAAA,EAAAA,cACzBd,CAAAA,EAAAA,GACCI,EAAkB,CAAEzC,QAAOmD,EAAAA,cAAA,CAAA,EAAOV,IAAsB,CAAE,EAIlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStore.react.js","sources":["../../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport type { Store, Selector } from './store.vanillajs'\n\nexport const useStore = <T>(\n store: Store<T>,\n selector: Selector<T> = (state) => state,\n // TODO pass selector\n // useSyncExternalStore((...args) => {\n // args[0].selector?? store.subscribe(...args) }, () => selector(store.getState()));\n) => [useSyncExternalStore(store.subscribe, () => selector(store.getState()))
|
|
1
|
+
{"version":3,"file":"useStore.react.js","sources":["../../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport type { Store, Selector } from './store.vanillajs'\n\n\nexport type useStoreType<T> = [\n Partial<T>,\n Store<T>['setState'],\n Store<T>['actions'],\n]\n\n\nexport const useStore = <T>(\n store: Store<T>,\n selector: Selector<T> = (state: Partial<T>) => state,\n // TODO pass selector\n // useSyncExternalStore((...args) => {\n // args[0].selector?? store.subscribe(...args) }, () => selector(store.getState()));\n): useStoreType<T> => [\n useSyncExternalStore(store.subscribe, () => selector(store.getState())),\n store.setState,\n store.actions,\n ]\n\n\nexport type useStoreApiType<T> = [\n ReturnType<typeof useStore>,\n Store<T>['getState'],\n Store<T>['setState'],\n Store<T>['actions'],\n]\n\n\nexport const useStoreApi = <T>(\n store: Store<T>,\n selector: Selector<T> = (state: Partial<T>) => state,\n): useStoreApiType<T> => ([\n useStore(store, selector),\n store.getState,\n store.setState,\n store?.actions,\n ])\n"],"names":["useStore","store","selector","arguments","length","undefined","state","useSyncExternalStore","subscribe","getState","setState","actions"],"mappings":"2FAYaA,EAAW,SACtBC,GAAe,IACfC,EAAqBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,SAACG,GAAiB,OAAKA,CAAK,EAAA,MAIhC,CAClBC,EAAoBA,qBAACN,EAAMO,WAAW,WAAA,OAAMN,EAASD,EAAMQ,WAAY,IACvER,EAAMS,SACNT,EAAMU,QACP,yCAWwB,SACzBV,GACoD,MAC5B,CACtBD,EAASC,EAFUE,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,SAACG,GAAiB,OAAKA,CAAK,GAGlDL,EAAMQ,SACNR,EAAMS,SACNT,aAAAA,EAAAA,EAAOU,QACR"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as e,objectSpread2 as r,defineProperty as t,asyncToGenerator as o,regeneratorRuntime as s,createForOfIteratorHelper as n}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../node_modules/core-js/modules/es.array.iterator.js";import"../../../../../node_modules/core-js/modules/es.object.to-string.js";import"../../../../../node_modules/core-js/modules/es.set.constructor.js";import"../../../../../node_modules/core-js/modules/es.string.iterator.js";import"../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import"../../../../../node_modules/core-js/modules/es.object.entries.js";import"../../../../../node_modules/core-js/modules/es.array.reduce.js";var u=function(u,a){var c,i=u,
|
|
1
|
+
import{slicedToArray as e,objectSpread2 as r,defineProperty as t,asyncToGenerator as o,regeneratorRuntime as s,createForOfIteratorHelper as n}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import"../../../../../node_modules/core-js/modules/es.array.iterator.js";import"../../../../../node_modules/core-js/modules/es.object.to-string.js";import"../../../../../node_modules/core-js/modules/es.set.constructor.js";import"../../../../../node_modules/core-js/modules/es.string.iterator.js";import"../../../../../node_modules/core-js/modules/web.dom-collections.iterator.js";import"../../../../../node_modules/core-js/modules/es.object.entries.js";import"../../../../../node_modules/core-js/modules/es.array.reduce.js";var u=function(u,a){var c,i=u,d=new Set,l=function(){return i},m=function(){var e=o(s().mark((function e(r){var t,o,u,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=r,t=n(d),e.prev=2,t.s();case 4:if((o=t.n()).done){e.next=11;break}return u=o.value,a=null==u?void 0:u.selector,e.next=9,u(a?a(i):i);case 9:e.next=4;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[2,13,16,19]])})));return function(r){return e.apply(this,arguments)}}(),p={getState:l,setState:m,subscribe:function(e){return d.add(e),function(){return d.delete(e)}}},f=a?null===(c=Object.entries(a))||void 0===c?void 0:c.reduce((function(n,u){var a=e(u,2),c=a[0],i=a[1];return r(r({},n),{},t({},c,o(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i(l,m));case 1:case"end":return e.stop()}}),e)})))))}),{}):null;return r(r({},p),f?{actions:r({},f)}:{})};export{u as createStore};
|
|
2
2
|
//# sourceMappingURL=store.vanillajs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\nexport type Selector<T> = (state: Partial<T>) => Partial<T>;\n\nexport type Listener<T> = {\n selector?: Selector<T>\n} & ListenerCallBack<T>\n\nexport type Store<T> = {\n getState: () => Partial<T>\n setState: (state: Partial<T>) => void\n subscribe: (listener: Listener<T>) => () => void\n} & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\nexport type ActionHandler<T> = (
|
|
1
|
+
{"version":3,"file":"store.vanillajs.js","sources":["../../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"sourcesContent":["\n// TinyStore, inspired by https://github.com/jherr/syncexternalstore/blob/main/csr/src/store.js\nexport type ListenerCallBack<T> = (state: Partial<T>) => void\n\nexport type Selector<T> = (state: Partial<T>) => Partial<T>;\n\nexport type Listener<T> = {\n selector?: Selector<T>\n} & ListenerCallBack<T>\n\nexport type Store<T> = {\n getState: () => Partial<T>\n setState: (state: Partial<T>) => void\n subscribe: (listener: Listener<T>) => () => void\n} & { actions?: { [actionName: string]: ActionHandlerCaller } }\n\n\nexport type ActionHandler<T> = (\n getState: Store<T>['getState'],\n setState: Store<T>['setState']\n) => void | Partial<T> | Promise<void | Partial<T>>\n\n\nexport type ActionHandlerCaller = () => void\n\n\nexport const createStore = <T>(initialState: Partial<T>, actions?: Record<string, ActionHandler<T>>): Store<T> => {\n let currentState: Partial<T> = initialState\n const listeners = new Set<Listener<T>>()\n\n\n const getState = () => currentState\n\n const setState = async (newState: Partial<T>) => {\n currentState = newState\n\n // eslint-disable-next-line no-restricted-syntax\n for (const listener of listeners) {\n // has Listener selector?\n const selector: Selector<T> | undefined = listener?.selector\n\n // TODO compare selected value to the previous values of that listener/selector pair\n // if listener.previousValue === selector(currentState) no call\n // else listener.previousValue = selector(currentState) and call\n // l1 cache, weak references?\n\n // TODO parallelize await\n // eslint-disable-next-line no-await-in-loop\n await listener(selector ? selector(currentState) : currentState)\n }\n }\n\n const storeBaseicApi: Store<T> = {\n getState,\n setState,\n subscribe: (listener: Listener<T>) => {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n }\n\n\n const resolvedActions: Record<string, ActionHandlerCaller> | null | undefined\n = actions ? Object.entries(actions)?.reduce(\n (\n aggregator: Record<string, ActionHandlerCaller>,\n [actionName, actionHandler]: [string, ActionHandler<T>],\n ) => ({\n ...aggregator,\n [actionName]: async() => actionHandler(getState, setState),\n }),\n {},\n ) : null\n\n const storeCombinedWithActions = {\n ...storeBaseicApi,\n ...(resolvedActions ? { actions: { ...resolvedActions } } : {}),\n }\n\n return storeCombinedWithActions\n}\n"],"names":["createStore","initialState","actions","_Object$entries","currentState","listeners","Set","getState","setState","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","newState","_iterator","_step","_listener","selector","wrap","_context","prev","next","_createForOfIteratorHelper","s","n","done","listener","value","t0","e","f","finish","stop","_x","apply","this","arguments","storeBaseicApi","subscribe","add","delete","resolvedActions","Object","entries","reduce","aggregator","_ref2","_ref3","_slicedToArray","actionName","actionHandler","_objectSpread","_defineProperty","_callee2","_context2","abrupt"],"mappings":"qtBA0BO,IAAMA,EAAc,SAAIC,EAA0BC,GAAyD,IAAAC,EAC5GC,EAA2BH,EACzBI,EAAY,IAAIC,IAGhBC,EAAW,WAAH,OAASH,CAAY,EAE7BI,EAAQ,WAAA,IAAAC,EAAAC,EAAAC,IAAAC,MAAG,SAAAC,EAAOC,GAAoB,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAP,IAAAQ,MAAA,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAC1ClB,EAAeU,EAEfC,EAAAQ,EACuBlB,GAASe,EAAAC,KAAA,EAAAN,EAAAS,IAAA,KAAA,EAAA,IAAAR,EAAAD,EAAAU,KAAAC,KAAA,CAAAN,EAAAE,KAAA,GAAA,KAAA,CAU9B,OAVSK,EAAQX,EAAAY,MAEXV,EAAoCS,eAAAA,EAAUT,SAQpDE,EAAAE,KAAA,EACMK,EAAST,EAAWA,EAASd,GAAgBA,GAAa,KAAA,EAAAgB,EAAAE,KAAA,EAAA,MAAA,KAAA,GAAAF,EAAAE,KAAA,GAAA,MAAA,KAAA,GAAAF,EAAAC,KAAA,GAAAD,EAAAS,GAAAT,EAAA,MAAA,GAAAL,EAAAe,EAAAV,EAAAS,IAAA,KAAA,GAAA,OAAAT,EAAAC,KAAA,GAAAN,EAAAgB,IAAAX,EAAAY,OAAA,IAAA,KAAA,GAAA,IAAA,MAAA,OAAAZ,EAAAa,OAAA,GAAApB,EAAA,KAAA,CAAA,CAAA,EAAA,GAAA,GAAA,KAEnE,KAAA,OAjBKL,SAAQ0B,GAAA,OAAAzB,EAAA0B,MAAAC,KAAAC,UAAA,EAAA,GAmBRC,EAA2B,CAC/B/B,SAAAA,EACAC,SAAAA,EACA+B,UAAW,SAACZ,GAEV,OADAtB,EAAUmC,IAAIb,GACP,WAAA,OAAMtB,EAAUoC,OAAOd,EAAS,CACzC,GAIIe,EACFxC,EAAiCC,QAA1BA,EAAGwC,OAAOC,QAAQ1C,cAAQC,SAAvBA,EAAyB0C,QACnC,SACEC,EAA+CC,GAAA,IAAAC,EAAAC,EAAAF,EAAA,GAC9CG,EAAUF,EAAA,GAAEG,EAAaH,EAAA,GAAA,OAAAI,EAAAA,EAEvBN,CAAAA,EAAAA,MAAUO,EAAA,CAAA,EACZH,EAAUxC,EAAAC,IAAAC,MAAG,SAAA0C,IAAA,OAAA3C,IAAAQ,MAAA,SAAAoC,GAAA,cAAAA,EAAAlC,KAAAkC,EAAAjC,MAAA,KAAA,EAAA,OAAAiC,EAAAC,OAAA,SAAWL,EAAc5C,EAAUC,IAAS,KAAA,EAAA,IAAA,MAAA,OAAA+C,EAAAtB,OAAA,GAAAqB,EAAA,MAAA,GAE5D,CAAA,GACE,KAON,OAL8BF,EAAAA,EACzBd,CAAAA,EAAAA,GACCI,EAAkB,CAAExC,QAAOkD,EAAA,CAAA,EAAOV,IAAsB,CAAE,EAIlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStore.react.js","sources":["../../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport type { Store, Selector } from './store.vanillajs'\n\nexport const useStore = <T>(\n store: Store<T>,\n selector: Selector<T> = (state) => state,\n // TODO pass selector\n // useSyncExternalStore((...args) => {\n // args[0].selector?? store.subscribe(...args) }, () => selector(store.getState()));\n) => [useSyncExternalStore(store.subscribe, () => selector(store.getState()))
|
|
1
|
+
{"version":3,"file":"useStore.react.js","sources":["../../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport type { Store, Selector } from './store.vanillajs'\n\n\nexport type useStoreType<T> = [\n Partial<T>,\n Store<T>['setState'],\n Store<T>['actions'],\n]\n\n\nexport const useStore = <T>(\n store: Store<T>,\n selector: Selector<T> = (state: Partial<T>) => state,\n // TODO pass selector\n // useSyncExternalStore((...args) => {\n // args[0].selector?? store.subscribe(...args) }, () => selector(store.getState()));\n): useStoreType<T> => [\n useSyncExternalStore(store.subscribe, () => selector(store.getState())),\n store.setState,\n store.actions,\n ]\n\n\nexport type useStoreApiType<T> = [\n ReturnType<typeof useStore>,\n Store<T>['getState'],\n Store<T>['setState'],\n Store<T>['actions'],\n]\n\n\nexport const useStoreApi = <T>(\n store: Store<T>,\n selector: Selector<T> = (state: Partial<T>) => state,\n): useStoreApiType<T> => ([\n useStore(store, selector),\n store.getState,\n store.setState,\n store?.actions,\n ])\n"],"names":["useStore","store","selector","arguments","length","undefined","state","useSyncExternalStore","subscribe","getState","setState","actions","useStoreApi"],"mappings":"iDAYaA,EAAW,SACtBC,GAAe,IACfC,EAAqBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,SAACG,GAAiB,OAAKA,CAAK,EAAA,MAIhC,CAClBC,EAAqBN,EAAMO,WAAW,WAAA,OAAMN,EAASD,EAAMQ,WAAY,IACvER,EAAMS,SACNT,EAAMU,QACP,EAWUC,EAAc,SACzBX,GACoD,MAC5B,CACtBD,EAASC,EAFUE,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,SAACG,GAAiB,OAAKA,CAAK,GAGlDL,EAAMQ,SACNR,EAAMS,SACNT,aAAAA,EAAAA,EAAOU,QACR"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const createStore = (initialState, actions) => {
|
|
2
2
|
let currentState = initialState;
|
|
3
3
|
const listeners = new Set();
|
|
4
|
+
const getState = () => currentState;
|
|
4
5
|
const setState = async (newState) => {
|
|
5
6
|
currentState = newState;
|
|
6
7
|
// eslint-disable-next-line no-restricted-syntax
|
|
@@ -17,7 +18,7 @@ export const createStore = (initialState, actions) => {
|
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
const storeBaseicApi = {
|
|
20
|
-
getState
|
|
21
|
+
getState,
|
|
21
22
|
setState,
|
|
22
23
|
subscribe: (listener) => {
|
|
23
24
|
listeners.add(listener);
|
|
@@ -26,7 +27,7 @@ export const createStore = (initialState, actions) => {
|
|
|
26
27
|
};
|
|
27
28
|
const resolvedActions = actions ? Object.entries(actions)?.reduce((aggregator, [actionName, actionHandler]) => ({
|
|
28
29
|
...aggregator,
|
|
29
|
-
[actionName]: () =>
|
|
30
|
+
[actionName]: async () => actionHandler(getState, setState),
|
|
30
31
|
}), {}) : null;
|
|
31
32
|
const storeCombinedWithActions = {
|
|
32
33
|
...storeBaseicApi,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.vanillajs.js","sourceRoot":"","sources":["../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.vanillajs.js","sourceRoot":"","sources":["../../../../../../../src/core/utils/appState/store/store.vanillajs.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAI,YAAwB,EAAE,OAA0C,EAAY,EAAE;IAC/G,IAAI,YAAY,GAAe,YAAY,CAAA;IAC3C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAe,CAAA;IAGxC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,YAAY,CAAA;IAEnC,MAAM,QAAQ,GAAG,KAAK,EAAE,QAAoB,EAAE,EAAE;QAC9C,YAAY,GAAG,QAAQ,CAAA;QAEvB,gDAAgD;QAChD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAChC,yBAAyB;YACzB,MAAM,QAAQ,GAA4B,QAAQ,EAAE,QAAQ,CAAA;YAE5D,oFAAoF;YACpF,+DAA+D;YAC/D,gEAAgE;YAChE,6BAA6B;YAE7B,yBAAyB;YACzB,4CAA4C;YAC5C,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;SACjE;IACH,CAAC,CAAA;IAED,MAAM,cAAc,GAAa;QAC/B,QAAQ;QACR,QAAQ;QACR,SAAS,EAAE,CAAC,QAAqB,EAAE,EAAE;YACnC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACvB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QACzC,CAAC;KACF,CAAA;IAGD,MAAM,eAAe,GACjB,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,CACzC,CACE,UAA+C,EAC/C,CAAC,UAAU,EAAE,aAAa,CAA6B,EACvD,EAAE,CAAC,CAAC;QACJ,GAAG,UAAU;QACb,CAAC,UAAU,CAAC,EAAE,KAAK,IAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAC3D,CAAC,EACF,EAAE,CACH,CAAC,CAAC,CAAC,IAAI,CAAA;IAEV,MAAM,wBAAwB,GAAG;QAC/B,GAAG,cAAc;QACjB,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,GAAG,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChE,CAAA;IAED,OAAO,wBAAwB,CAAA;AACjC,CAAC,CAAA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { useSyncExternalStore } from 'react';
|
|
2
|
-
export const useStore = (store, selector = (state) => state) => [
|
|
2
|
+
export const useStore = (store, selector = (state) => state) => [
|
|
3
|
+
useSyncExternalStore(store.subscribe, () => selector(store.getState())),
|
|
4
|
+
store.setState,
|
|
5
|
+
store.actions,
|
|
6
|
+
];
|
|
3
7
|
export const useStoreApi = (store, selector = (state) => state) => ([
|
|
4
8
|
useStore(store, selector),
|
|
5
9
|
store.getState,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStore.react.js","sourceRoot":"","sources":["../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useStore.react.js","sourceRoot":"","sources":["../../../../../../../src/core/utils/appState/store/useStore.react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAY5C,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,KAAe,EACf,WAAwB,CAAC,KAAiB,EAAE,EAAE,CAAC,KAAK,EAInC,EAAE,CAAC;IAClB,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvE,KAAK,CAAC,QAAQ;IACd,KAAK,CAAC,OAAO;CACd,CAAA;AAWH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,KAAe,EACf,WAAwB,CAAC,KAAiB,EAAE,EAAE,CAAC,KAAK,EAChC,EAAE,CAAC,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,KAAK,CAAC,QAAQ;IACd,KAAK,CAAC,QAAQ;IACd,KAAK,EAAE,OAAO;CACf,CAAC,CAAA"}
|