@plitzi/nexus 0.32.0 → 0.32.2
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/CHANGELOG.md +39 -0
- package/README.md +211 -27
- package/dist/advanced/index.d.ts +5 -0
- package/dist/advanced/index.mjs +10 -0
- package/dist/async/index.d.ts +0 -2
- package/dist/async/index.mjs +1 -3
- package/dist/createStore/createStore.d.ts +3 -43
- package/dist/createStore/createStore.mjs +85 -100
- package/dist/createStore/helpers/PathTrie.mjs +14 -14
- package/dist/createStore/helpers/createChainReads.d.ts +1 -1
- package/dist/createStore/helpers/createChainReads.mjs +22 -13
- package/dist/createStore/helpers/createSetState.mjs +11 -9
- package/dist/createStore/helpers/forwardParentChanges.mjs +16 -13
- package/dist/createStore/index.mjs +3 -3
- package/dist/derived/index.d.ts +0 -1
- package/dist/derived/index.mjs +1 -2
- package/dist/entities/createEntityStore.d.ts +0 -3
- package/dist/entities/createEntityStore.mjs +71 -78
- package/dist/env.d.ts +4 -0
- package/dist/env.mjs +3 -0
- package/dist/history/index.d.ts +0 -2
- package/dist/history/index.mjs +1 -2
- package/dist/index.d.ts +23 -15
- package/dist/index.mjs +14 -22
- package/dist/middleware/historyMiddleware.mjs +26 -26
- package/dist/middleware/persistMiddleware.mjs +11 -11
- package/dist/middleware/recorderMiddleware.d.ts +21 -0
- package/dist/middleware/recorderMiddleware.mjs +33 -0
- package/dist/{StoreContext.d.ts → react/StoreContext.d.ts} +1 -1
- package/dist/{StoreContext.mjs → react/StoreContext.mjs} +1 -1
- package/dist/{StoreProvider.d.ts → react/StoreProvider.d.ts} +4 -2
- package/dist/react/StoreProvider.mjs +62 -0
- package/dist/react/createStoreHook.d.ts +44 -0
- package/dist/react/createStoreHook.mjs +27 -0
- package/dist/{createStore → react}/hooks/shared.mjs +2 -2
- package/dist/{async → react}/hooks/useAsync.d.ts +1 -1
- package/dist/{async → react}/hooks/useAsync.mjs +1 -1
- package/dist/{async → react}/hooks/useAsyncValue.d.ts +1 -1
- package/dist/{async → react}/hooks/useAsyncValue.mjs +1 -1
- package/dist/{derived → react}/hooks/useDerived.d.ts +1 -1
- package/dist/{derived → react}/hooks/useDerived.mjs +1 -1
- package/dist/react/hooks/useEntity.d.ts +10 -0
- package/dist/react/hooks/useEntity.mjs +23 -0
- package/dist/{createStore → react}/hooks/useStore.mjs +2 -2
- package/dist/{createStore → react}/hooks/useStoreById.mjs +2 -2
- package/dist/{createStore → react}/hooks/useStoreGetter.mjs +1 -1
- package/dist/react/hooks/useStoreHistory.mjs +29 -0
- package/dist/{createStore → react}/hooks/useStoreSetter.mjs +1 -1
- package/dist/{createStore → react}/hooks/useStoreSync.mjs +2 -2
- package/dist/react/index.d.ts +17 -0
- package/dist/react/index.mjs +16 -0
- package/dist/{helpers → react}/useIsomorphicLayoutEffect.mjs +1 -1
- package/dist/types/StoreTypes.d.ts +21 -0
- package/dist/vue/index.d.ts +8 -0
- package/dist/vue/index.mjs +7 -0
- package/dist/vue/injection.d.ts +3 -0
- package/dist/vue/injection.mjs +13 -0
- package/dist/vue/useAsync.d.ts +3 -0
- package/dist/vue/useAsync.mjs +10 -0
- package/dist/vue/useDerived.d.ts +3 -0
- package/dist/vue/useDerived.mjs +10 -0
- package/dist/vue/useEntity.d.ts +11 -0
- package/dist/vue/useEntity.mjs +29 -0
- package/dist/vue/useStore.d.ts +13 -0
- package/dist/vue/useStore.mjs +31 -0
- package/dist/vue/useStoreHistory.d.ts +12 -0
- package/dist/vue/useStoreHistory.mjs +33 -0
- package/logo.svg +77 -22
- package/package.json +133 -56
- package/dist/StoreProvider.mjs +0 -57
- package/dist/history/hooks/useStoreHistory.mjs +0 -24
- /package/dist/{createStore → react}/hooks/shared.d.ts +0 -0
- /package/dist/{createStore → react}/hooks/useStore.d.ts +0 -0
- /package/dist/{createStore → react}/hooks/useStoreById.d.ts +0 -0
- /package/dist/{createStore → react}/hooks/useStoreGetter.d.ts +0 -0
- /package/dist/{history → react}/hooks/useStoreHistory.d.ts +0 -0
- /package/dist/{createStore → react}/hooks/useStoreSetter.d.ts +0 -0
- /package/dist/{createStore → react}/hooks/useStoreSync.d.ts +0 -0
- /package/dist/{helpers → react}/useIsomorphicLayoutEffect.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/nexus",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -24,28 +24,41 @@
|
|
|
24
24
|
"sideEffects": false,
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"eslint": "^9.39.4",
|
|
27
|
-
"react": "^19.2.
|
|
28
|
-
"react-dom": "^19.2.
|
|
27
|
+
"react": "^19.2.7",
|
|
28
|
+
"react-dom": "^19.2.7",
|
|
29
29
|
"typescript": "^6.0.3",
|
|
30
|
-
"vite": "^8.0.
|
|
31
|
-
"vitest": "^4.1.
|
|
30
|
+
"vite": "^8.0.16",
|
|
31
|
+
"vitest": "^4.1.9",
|
|
32
|
+
"vue": "^3.5.13"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"react": "^18.0.0 || ^19.0.0",
|
|
35
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
36
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
37
|
+
"vue": "^3.4.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"react": {
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"react-dom": {
|
|
44
|
+
"optional": true
|
|
45
|
+
},
|
|
46
|
+
"vue": {
|
|
47
|
+
"optional": true
|
|
48
|
+
}
|
|
36
49
|
},
|
|
37
50
|
"exports": {
|
|
38
51
|
".": {
|
|
39
52
|
"types": "./dist/index.d.ts",
|
|
40
53
|
"import": "./dist/index.mjs"
|
|
41
54
|
},
|
|
42
|
-
"./
|
|
43
|
-
"types": "./dist/
|
|
44
|
-
"import": "./dist/
|
|
55
|
+
"./advanced": {
|
|
56
|
+
"types": "./dist/advanced/index.d.ts",
|
|
57
|
+
"import": "./dist/advanced/index.mjs"
|
|
45
58
|
},
|
|
46
|
-
"./
|
|
47
|
-
"types": "./dist/
|
|
48
|
-
"import": "./dist/
|
|
59
|
+
"./advanced/index": {
|
|
60
|
+
"types": "./dist/advanced/index.d.ts",
|
|
61
|
+
"import": "./dist/advanced/index.mjs"
|
|
49
62
|
},
|
|
50
63
|
"./async": {
|
|
51
64
|
"types": "./dist/async/index.d.ts",
|
|
@@ -55,14 +68,6 @@
|
|
|
55
68
|
"types": "./dist/async/createAsync.d.ts",
|
|
56
69
|
"import": "./dist/async/createAsync.mjs"
|
|
57
70
|
},
|
|
58
|
-
"./async/hooks/useAsync": {
|
|
59
|
-
"types": "./dist/async/hooks/useAsync.d.ts",
|
|
60
|
-
"import": "./dist/async/hooks/useAsync.mjs"
|
|
61
|
-
},
|
|
62
|
-
"./async/hooks/useAsyncValue": {
|
|
63
|
-
"types": "./dist/async/hooks/useAsyncValue.d.ts",
|
|
64
|
-
"import": "./dist/async/hooks/useAsyncValue.mjs"
|
|
65
|
-
},
|
|
66
71
|
"./async/index": {
|
|
67
72
|
"types": "./dist/async/index.d.ts",
|
|
68
73
|
"import": "./dist/async/index.mjs"
|
|
@@ -107,30 +112,6 @@
|
|
|
107
112
|
"types": "./dist/createStore/helpers/writeByPath.d.ts",
|
|
108
113
|
"import": "./dist/createStore/helpers/writeByPath.mjs"
|
|
109
114
|
},
|
|
110
|
-
"./createStore/hooks/shared": {
|
|
111
|
-
"types": "./dist/createStore/hooks/shared.d.ts",
|
|
112
|
-
"import": "./dist/createStore/hooks/shared.mjs"
|
|
113
|
-
},
|
|
114
|
-
"./createStore/hooks/useStore": {
|
|
115
|
-
"types": "./dist/createStore/hooks/useStore.d.ts",
|
|
116
|
-
"import": "./dist/createStore/hooks/useStore.mjs"
|
|
117
|
-
},
|
|
118
|
-
"./createStore/hooks/useStoreById": {
|
|
119
|
-
"types": "./dist/createStore/hooks/useStoreById.d.ts",
|
|
120
|
-
"import": "./dist/createStore/hooks/useStoreById.mjs"
|
|
121
|
-
},
|
|
122
|
-
"./createStore/hooks/useStoreGetter": {
|
|
123
|
-
"types": "./dist/createStore/hooks/useStoreGetter.d.ts",
|
|
124
|
-
"import": "./dist/createStore/hooks/useStoreGetter.mjs"
|
|
125
|
-
},
|
|
126
|
-
"./createStore/hooks/useStoreSetter": {
|
|
127
|
-
"types": "./dist/createStore/hooks/useStoreSetter.d.ts",
|
|
128
|
-
"import": "./dist/createStore/hooks/useStoreSetter.mjs"
|
|
129
|
-
},
|
|
130
|
-
"./createStore/hooks/useStoreSync": {
|
|
131
|
-
"types": "./dist/createStore/hooks/useStoreSync.d.ts",
|
|
132
|
-
"import": "./dist/createStore/hooks/useStoreSync.mjs"
|
|
133
|
-
},
|
|
134
115
|
"./createStore/index": {
|
|
135
116
|
"types": "./dist/createStore/index.d.ts",
|
|
136
117
|
"import": "./dist/createStore/index.mjs"
|
|
@@ -143,10 +124,6 @@
|
|
|
143
124
|
"types": "./dist/derived/createDerived.d.ts",
|
|
144
125
|
"import": "./dist/derived/createDerived.mjs"
|
|
145
126
|
},
|
|
146
|
-
"./derived/hooks/useDerived": {
|
|
147
|
-
"types": "./dist/derived/hooks/useDerived.d.ts",
|
|
148
|
-
"import": "./dist/derived/hooks/useDerived.mjs"
|
|
149
|
-
},
|
|
150
127
|
"./derived/index": {
|
|
151
128
|
"types": "./dist/derived/index.d.ts",
|
|
152
129
|
"import": "./dist/derived/index.mjs"
|
|
@@ -167,6 +144,10 @@
|
|
|
167
144
|
"types": "./dist/entities/index.d.ts",
|
|
168
145
|
"import": "./dist/entities/index.mjs"
|
|
169
146
|
},
|
|
147
|
+
"./env": {
|
|
148
|
+
"types": "./dist/env.d.ts",
|
|
149
|
+
"import": "./dist/env.mjs"
|
|
150
|
+
},
|
|
170
151
|
"./helpers/createObservable": {
|
|
171
152
|
"types": "./dist/helpers/createObservable.d.ts",
|
|
172
153
|
"import": "./dist/helpers/createObservable.mjs"
|
|
@@ -191,18 +172,10 @@
|
|
|
191
172
|
"types": "./dist/helpers/shallowEqual.d.ts",
|
|
192
173
|
"import": "./dist/helpers/shallowEqual.mjs"
|
|
193
174
|
},
|
|
194
|
-
"./helpers/useIsomorphicLayoutEffect": {
|
|
195
|
-
"types": "./dist/helpers/useIsomorphicLayoutEffect.d.ts",
|
|
196
|
-
"import": "./dist/helpers/useIsomorphicLayoutEffect.mjs"
|
|
197
|
-
},
|
|
198
175
|
"./history": {
|
|
199
176
|
"types": "./dist/history/index.d.ts",
|
|
200
177
|
"import": "./dist/history/index.mjs"
|
|
201
178
|
},
|
|
202
|
-
"./history/hooks/useStoreHistory": {
|
|
203
|
-
"types": "./dist/history/hooks/useStoreHistory.d.ts",
|
|
204
|
-
"import": "./dist/history/hooks/useStoreHistory.mjs"
|
|
205
|
-
},
|
|
206
179
|
"./history/index": {
|
|
207
180
|
"types": "./dist/history/index.d.ts",
|
|
208
181
|
"import": "./dist/history/index.mjs"
|
|
@@ -239,6 +212,10 @@
|
|
|
239
212
|
"types": "./dist/middleware/persistMiddleware.d.ts",
|
|
240
213
|
"import": "./dist/middleware/persistMiddleware.mjs"
|
|
241
214
|
},
|
|
215
|
+
"./middleware/recorderMiddleware": {
|
|
216
|
+
"types": "./dist/middleware/recorderMiddleware.d.ts",
|
|
217
|
+
"import": "./dist/middleware/recorderMiddleware.mjs"
|
|
218
|
+
},
|
|
242
219
|
"./middleware/reduxDevToolsMiddleware": {
|
|
243
220
|
"types": "./dist/middleware/reduxDevToolsMiddleware.d.ts",
|
|
244
221
|
"import": "./dist/middleware/reduxDevToolsMiddleware.mjs"
|
|
@@ -251,6 +228,74 @@
|
|
|
251
228
|
"types": "./dist/next/index.d.ts",
|
|
252
229
|
"import": "./dist/next/index.mjs"
|
|
253
230
|
},
|
|
231
|
+
"./react": {
|
|
232
|
+
"types": "./dist/react/index.d.ts",
|
|
233
|
+
"import": "./dist/react/index.mjs"
|
|
234
|
+
},
|
|
235
|
+
"./react/StoreContext": {
|
|
236
|
+
"types": "./dist/react/StoreContext.d.ts",
|
|
237
|
+
"import": "./dist/react/StoreContext.mjs"
|
|
238
|
+
},
|
|
239
|
+
"./react/StoreProvider": {
|
|
240
|
+
"types": "./dist/react/StoreProvider.d.ts",
|
|
241
|
+
"import": "./dist/react/StoreProvider.mjs"
|
|
242
|
+
},
|
|
243
|
+
"./react/createStoreHook": {
|
|
244
|
+
"types": "./dist/react/createStoreHook.d.ts",
|
|
245
|
+
"import": "./dist/react/createStoreHook.mjs"
|
|
246
|
+
},
|
|
247
|
+
"./react/hooks/shared": {
|
|
248
|
+
"types": "./dist/react/hooks/shared.d.ts",
|
|
249
|
+
"import": "./dist/react/hooks/shared.mjs"
|
|
250
|
+
},
|
|
251
|
+
"./react/hooks/useAsync": {
|
|
252
|
+
"types": "./dist/react/hooks/useAsync.d.ts",
|
|
253
|
+
"import": "./dist/react/hooks/useAsync.mjs"
|
|
254
|
+
},
|
|
255
|
+
"./react/hooks/useAsyncValue": {
|
|
256
|
+
"types": "./dist/react/hooks/useAsyncValue.d.ts",
|
|
257
|
+
"import": "./dist/react/hooks/useAsyncValue.mjs"
|
|
258
|
+
},
|
|
259
|
+
"./react/hooks/useDerived": {
|
|
260
|
+
"types": "./dist/react/hooks/useDerived.d.ts",
|
|
261
|
+
"import": "./dist/react/hooks/useDerived.mjs"
|
|
262
|
+
},
|
|
263
|
+
"./react/hooks/useEntity": {
|
|
264
|
+
"types": "./dist/react/hooks/useEntity.d.ts",
|
|
265
|
+
"import": "./dist/react/hooks/useEntity.mjs"
|
|
266
|
+
},
|
|
267
|
+
"./react/hooks/useStore": {
|
|
268
|
+
"types": "./dist/react/hooks/useStore.d.ts",
|
|
269
|
+
"import": "./dist/react/hooks/useStore.mjs"
|
|
270
|
+
},
|
|
271
|
+
"./react/hooks/useStoreById": {
|
|
272
|
+
"types": "./dist/react/hooks/useStoreById.d.ts",
|
|
273
|
+
"import": "./dist/react/hooks/useStoreById.mjs"
|
|
274
|
+
},
|
|
275
|
+
"./react/hooks/useStoreGetter": {
|
|
276
|
+
"types": "./dist/react/hooks/useStoreGetter.d.ts",
|
|
277
|
+
"import": "./dist/react/hooks/useStoreGetter.mjs"
|
|
278
|
+
},
|
|
279
|
+
"./react/hooks/useStoreHistory": {
|
|
280
|
+
"types": "./dist/react/hooks/useStoreHistory.d.ts",
|
|
281
|
+
"import": "./dist/react/hooks/useStoreHistory.mjs"
|
|
282
|
+
},
|
|
283
|
+
"./react/hooks/useStoreSetter": {
|
|
284
|
+
"types": "./dist/react/hooks/useStoreSetter.d.ts",
|
|
285
|
+
"import": "./dist/react/hooks/useStoreSetter.mjs"
|
|
286
|
+
},
|
|
287
|
+
"./react/hooks/useStoreSync": {
|
|
288
|
+
"types": "./dist/react/hooks/useStoreSync.d.ts",
|
|
289
|
+
"import": "./dist/react/hooks/useStoreSync.mjs"
|
|
290
|
+
},
|
|
291
|
+
"./react/index": {
|
|
292
|
+
"types": "./dist/react/index.d.ts",
|
|
293
|
+
"import": "./dist/react/index.mjs"
|
|
294
|
+
},
|
|
295
|
+
"./react/useIsomorphicLayoutEffect": {
|
|
296
|
+
"types": "./dist/react/useIsomorphicLayoutEffect.d.ts",
|
|
297
|
+
"import": "./dist/react/useIsomorphicLayoutEffect.mjs"
|
|
298
|
+
},
|
|
254
299
|
"./rsc/index": {
|
|
255
300
|
"import": "./dist/rsc/index.mjs"
|
|
256
301
|
},
|
|
@@ -264,6 +309,38 @@
|
|
|
264
309
|
"./types/index": {
|
|
265
310
|
"types": "./dist/types/index.d.ts",
|
|
266
311
|
"import": "./dist/types/index.mjs"
|
|
312
|
+
},
|
|
313
|
+
"./vue": {
|
|
314
|
+
"types": "./dist/vue/index.d.ts",
|
|
315
|
+
"import": "./dist/vue/index.mjs"
|
|
316
|
+
},
|
|
317
|
+
"./vue/index": {
|
|
318
|
+
"types": "./dist/vue/index.d.ts",
|
|
319
|
+
"import": "./dist/vue/index.mjs"
|
|
320
|
+
},
|
|
321
|
+
"./vue/injection": {
|
|
322
|
+
"types": "./dist/vue/injection.d.ts",
|
|
323
|
+
"import": "./dist/vue/injection.mjs"
|
|
324
|
+
},
|
|
325
|
+
"./vue/useAsync": {
|
|
326
|
+
"types": "./dist/vue/useAsync.d.ts",
|
|
327
|
+
"import": "./dist/vue/useAsync.mjs"
|
|
328
|
+
},
|
|
329
|
+
"./vue/useDerived": {
|
|
330
|
+
"types": "./dist/vue/useDerived.d.ts",
|
|
331
|
+
"import": "./dist/vue/useDerived.mjs"
|
|
332
|
+
},
|
|
333
|
+
"./vue/useEntity": {
|
|
334
|
+
"types": "./dist/vue/useEntity.d.ts",
|
|
335
|
+
"import": "./dist/vue/useEntity.mjs"
|
|
336
|
+
},
|
|
337
|
+
"./vue/useStore": {
|
|
338
|
+
"types": "./dist/vue/useStore.d.ts",
|
|
339
|
+
"import": "./dist/vue/useStore.mjs"
|
|
340
|
+
},
|
|
341
|
+
"./vue/useStoreHistory": {
|
|
342
|
+
"types": "./dist/vue/useStoreHistory.d.ts",
|
|
343
|
+
"import": "./dist/vue/useStoreHistory.mjs"
|
|
267
344
|
}
|
|
268
345
|
}
|
|
269
346
|
}
|
package/dist/StoreProvider.mjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { StoreContext as e, StoreRegistryContext as t } from "./StoreContext.mjs";
|
|
2
|
-
import n from "./createStore/hooks/useStoreSync.mjs";
|
|
3
|
-
import r from "./createStore/index.mjs";
|
|
4
|
-
import { isServerSnapshot as i, stripServerFlag as a } from "./rsc/index.mjs";
|
|
5
|
-
import { createContext as o, useContext as s, useEffect as c, useMemo as l, useRef as u } from "react";
|
|
6
|
-
import { jsx as d } from "react/jsx-runtime";
|
|
7
|
-
//#region src/StoreProvider.tsx
|
|
8
|
-
var f = o(void 0), p = (e) => e.cascade === !0, m = ({ store: o, id: m, path: h, value: g, inherit: _, autoSync: v = !0, middlewares: y, children: b }) => {
|
|
9
|
-
let x = s(e), S = s(f), C = s(t), w = u(void 0), T = _ === "live", E = l(() => {
|
|
10
|
-
let e = _ === "snapshot" && x ? x.getState() : {}, t = typeof g == "function" ? g(e) : {
|
|
11
|
-
...e,
|
|
12
|
-
...g
|
|
13
|
-
};
|
|
14
|
-
return i(t) ? a(t) : t;
|
|
15
|
-
}, [
|
|
16
|
-
_,
|
|
17
|
-
x,
|
|
18
|
-
g
|
|
19
|
-
]), D = y ?? [], O = S ? [...S, ...D] : D, k = l(() => [...S ?? [], ...D.filter(p)], [S, y]);
|
|
20
|
-
w.current ||= o ?? r(() => E, {
|
|
21
|
-
id: m,
|
|
22
|
-
parent: T ? x : void 0,
|
|
23
|
-
middlewares: O.length > 0 ? O : void 0,
|
|
24
|
-
deferHydrate: !0
|
|
25
|
-
});
|
|
26
|
-
let A = l(() => m ? {
|
|
27
|
-
id: m,
|
|
28
|
-
store: w.current,
|
|
29
|
-
parent: C
|
|
30
|
-
} : C, [m, C]);
|
|
31
|
-
u(!1), c(() => {}, [m, C]), c(() => (T && !o && w.current?.reconnect?.(), () => {
|
|
32
|
-
T && !o && w.current?.destroy?.();
|
|
33
|
-
}), [T, o]);
|
|
34
|
-
let j = u(!1);
|
|
35
|
-
c(() => {
|
|
36
|
-
!j.current && w.current?.hydrate && (w.current.hydrate(), j.current = !0);
|
|
37
|
-
}, []);
|
|
38
|
-
let M = !!g && v;
|
|
39
|
-
return n(h, h ? g : E, {
|
|
40
|
-
enabled: M && !!h,
|
|
41
|
-
store: w.current
|
|
42
|
-
}), n(void 0, E, {
|
|
43
|
-
enabled: M && !h,
|
|
44
|
-
store: w.current
|
|
45
|
-
}), /* @__PURE__ */ d(f, {
|
|
46
|
-
value: k.length > 0 ? k : void 0,
|
|
47
|
-
children: /* @__PURE__ */ d(t, {
|
|
48
|
-
value: A,
|
|
49
|
-
children: /* @__PURE__ */ d(e, {
|
|
50
|
-
value: w.current,
|
|
51
|
-
children: b
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
//#endregion
|
|
57
|
-
export { m as default };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useResolvedStore as e } from "../../createStore/hooks/shared.mjs";
|
|
2
|
-
import { getStoreHistory as t } from "../../middleware/historyMiddleware.mjs";
|
|
3
|
-
import { useEffect as n, useSyncExternalStore as r } from "react";
|
|
4
|
-
//#region src/history/hooks/useStoreHistory.ts
|
|
5
|
-
var i = {
|
|
6
|
-
entries: [],
|
|
7
|
-
index: -1,
|
|
8
|
-
canUndo: !1,
|
|
9
|
-
canRedo: !1
|
|
10
|
-
}, a = () => {}, o = () => a, s = () => i;
|
|
11
|
-
function c() {
|
|
12
|
-
let i = e(void 0, "useStoreHistory"), c = t(i);
|
|
13
|
-
n(() => {}, [c, i]);
|
|
14
|
-
let l = c?.getSnapshot ?? s;
|
|
15
|
-
return {
|
|
16
|
-
...r(c?.subscribe ?? o, l, l),
|
|
17
|
-
undo: c?.undo ?? a,
|
|
18
|
-
redo: c?.redo ?? a,
|
|
19
|
-
travelTo: c?.travelTo ?? a,
|
|
20
|
-
clear: c?.clear ?? a
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { c as useStoreHistory };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|