atom.io 0.31.1 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/dist/index.d.ts +867 -101
- package/data/dist/index.js +10 -558
- package/data/src/index.ts +0 -2
- package/data/src/struct-family.ts +1 -1
- package/data/src/struct.ts +1 -2
- package/dist/chunk-354XQWHH.js +153 -0
- package/dist/chunk-4LWKCEW3.js +14 -0
- package/dist/chunk-5F2V7S3B.js +83 -0
- package/dist/chunk-ECOMOMUN.js +631 -0
- package/dist/{chunk-Y5MBNTVU.js → chunk-GY2XQYZY.js} +1791 -703
- package/dist/chunk-NF7FJKJD.js +107 -0
- package/dist/chunk-R3ZUK5EH.js +1024 -0
- package/dist/chunk-Z2UJW4NQ.js +523 -0
- package/dist/index.d.ts +622 -26
- package/dist/index.js +1 -228
- package/eslint-plugin/dist/index.d.ts +1 -30
- package/eslint-plugin/dist/index.js +0 -146
- package/eslint-plugin/src/index.ts +0 -1
- package/eslint-plugin/src/rules/index.ts +0 -1
- package/internal/dist/index.d.ts +783 -64
- package/internal/dist/index.js +1 -1
- package/internal/src/atom/create-regular-atom.ts +3 -3
- package/internal/src/atom/dispose-atom.ts +4 -13
- package/internal/src/atom/is-default.ts +3 -3
- package/internal/src/caching.ts +5 -5
- package/internal/src/capitalize.ts +3 -0
- package/internal/src/families/create-readonly-selector-family.ts +5 -6
- package/internal/src/families/create-writable-selector-family.ts +1 -4
- package/internal/src/families/dispose-from-store.ts +3 -13
- package/internal/src/get-state/get-from-store.ts +2 -2
- package/internal/src/get-state/read-or-compute-value.ts +1 -1
- package/internal/src/index.ts +2 -0
- package/internal/src/install-into-store.ts +1 -1
- package/internal/src/join/edit-relations-in-store.ts +32 -0
- package/internal/src/join/find-relations-in-store.ts +124 -0
- package/internal/src/join/get-internal-relations-from-store.ts +14 -0
- package/internal/src/join/get-join.ts +31 -0
- package/internal/src/join/index.ts +5 -0
- package/{data/src/join.ts → internal/src/join/join-internal.ts} +20 -429
- package/internal/src/keys.ts +7 -7
- package/internal/src/mutable/create-mutable-atom-family.ts +1 -1
- package/internal/src/mutable/create-mutable-atom.ts +3 -3
- package/internal/src/mutable/get-json-token.ts +1 -1
- package/internal/src/mutable/tracker-family.ts +19 -17
- package/internal/src/mutable/tracker.ts +8 -8
- package/internal/src/pretty-print.ts +1 -1
- package/internal/src/selector/create-readonly-selector.ts +3 -7
- package/internal/src/selector/create-writable-selector.ts +4 -4
- package/internal/src/selector/dispose-selector.ts +20 -11
- package/internal/src/selector/get-selector-dependency-keys.ts +1 -1
- package/internal/src/selector/register-selector.ts +6 -9
- package/internal/src/selector/trace-selector-atoms.ts +2 -2
- package/internal/src/set-state/copy-mutable-if-needed.ts +1 -1
- package/internal/src/set-state/emit-update.ts +1 -1
- package/internal/src/set-state/evict-downstream.ts +1 -1
- package/internal/src/set-state/set-atom-or-selector.ts +1 -1
- package/internal/src/set-state/set-atom.ts +10 -10
- package/internal/src/set-state/set-into-store.ts +2 -2
- package/internal/src/set-state/stow-update.ts +1 -1
- package/internal/src/store/store.ts +1 -1
- package/internal/src/store/withdraw.ts +22 -22
- package/internal/src/subscribe/recall-state.ts +1 -1
- package/internal/src/subscribe/subscribe-in-store.ts +3 -3
- package/internal/src/subscribe/subscribe-to-root-atoms.ts +3 -3
- package/internal/src/subscribe/subscribe-to-state.ts +5 -5
- package/internal/src/subscribe/subscribe-to-timeline.ts +3 -3
- package/internal/src/subscribe/subscribe-to-transaction.ts +3 -3
- package/internal/src/timeline/create-timeline.ts +17 -37
- package/internal/src/transaction/act-upon-store.ts +2 -2
- package/internal/src/transaction/apply-transaction.ts +5 -5
- package/internal/src/transaction/assign-transaction-to-continuity.ts +1 -1
- package/internal/src/transaction/build-transaction.ts +5 -8
- package/internal/src/transaction/create-transaction.ts +3 -3
- package/internal/src/transaction/get-epoch-number.ts +3 -3
- package/internal/src/transaction/set-epoch-number.ts +2 -2
- package/introspection/dist/index.d.ts +922 -6
- package/introspection/dist/index.js +2 -620
- package/json/dist/index.d.ts +899 -5
- package/json/dist/index.js +1 -80
- package/json/src/select-json-family.ts +3 -14
- package/package.json +24 -42
- package/react/dist/index.d.ts +921 -3
- package/react/dist/index.js +2 -82
- package/react/src/use-o.ts +1 -1
- package/react/src/use-tl.ts +2 -2
- package/react-devtools/dist/index.css +16 -14
- package/react-devtools/dist/index.d.ts +26 -1
- package/react-devtools/dist/index.js +6 -6
- package/react-devtools/src/devtools.scss +16 -14
- package/realtime/dist/index.d.ts +202 -8
- package/realtime/dist/index.js +2 -107
- package/realtime/src/realtime-continuity.ts +2 -2
- package/realtime/src/shared-room-store.ts +1 -2
- package/realtime-client/dist/index.d.ts +960 -22
- package/realtime-client/dist/index.js +3 -509
- package/realtime-client/src/continuity/register-and-attempt-confirmed-update.ts +3 -3
- package/realtime-client/src/continuity/use-conceal-state.ts +1 -1
- package/realtime-client/src/pull-atom-family-member.ts +2 -2
- package/realtime-client/src/pull-atom.ts +2 -2
- package/realtime-client/src/pull-mutable-atom-family-member.ts +2 -2
- package/realtime-client/src/pull-mutable-atom.ts +2 -2
- package/realtime-client/src/pull-selector-family-member.ts +4 -4
- package/realtime-client/src/pull-selector.ts +4 -4
- package/realtime-client/src/push-state.ts +5 -10
- package/realtime-client/src/server-action.ts +4 -4
- package/realtime-client/src/sync-continuity.ts +6 -6
- package/realtime-react/dist/index.d.ts +166 -12
- package/realtime-react/dist/index.js +5 -154
- package/realtime-react/src/use-pull-atom-family-member.ts +1 -1
- package/realtime-react/src/use-pull-atom.ts +1 -1
- package/realtime-react/src/use-pull-mutable-atom.ts +1 -1
- package/realtime-react/src/use-pull-mutable-family-member.ts +1 -1
- package/realtime-react/src/use-pull-selector-family-member.ts +1 -1
- package/realtime-react/src/use-pull-selector.ts +1 -1
- package/realtime-react/src/use-push.ts +1 -1
- package/realtime-react/src/use-server-action.ts +2 -2
- package/realtime-react/src/use-sync-continuity.ts +1 -1
- package/realtime-server/dist/index.d.ts +971 -28
- package/realtime-server/dist/index.js +3 -1001
- package/realtime-server/src/continuity/prepare-to-serve-transaction-request.ts +1 -1
- package/realtime-server/src/continuity/prepare-to-sync-realtime-continuity.ts +3 -3
- package/realtime-server/src/continuity/subscribe-to-continuity-actions.ts +2 -2
- package/realtime-server/src/continuity/subscribe-to-continuity-perpectives.ts +2 -2
- package/realtime-server/src/realtime-action-receiver.ts +1 -1
- package/realtime-server/src/realtime-family-provider.ts +2 -2
- package/realtime-server/src/realtime-mutable-family-provider.ts +2 -2
- package/realtime-server/src/realtime-mutable-provider.ts +2 -2
- package/realtime-server/src/realtime-server-stores/server-room-external-actions.ts +2 -1
- package/realtime-server/src/realtime-server-stores/server-room-external-store.ts +1 -1
- package/realtime-server/src/realtime-server-stores/server-user-store.ts +1 -2
- package/realtime-server/src/realtime-state-provider.ts +2 -2
- package/realtime-testing/dist/index.d.ts +1091 -3
- package/realtime-testing/dist/index.js +20 -22
- package/realtime-testing/src/setup-realtime-test.tsx +2 -1
- package/src/index.ts +4 -0
- package/src/join.ts +218 -0
- package/src/silo.ts +4 -4
- package/src/timeline.ts +1 -1
- package/src/transaction.ts +4 -8
- package/transceivers/set-rtx/dist/index.d.ts +37 -2
- package/transceivers/set-rtx/dist/index.js +1 -215
- package/web/dist/index.d.ts +30 -1
- package/web/dist/index.js +1 -15
- package/data/src/until.ts +0 -15
- package/ephemeral/dist/index.d.ts +0 -67
- package/ephemeral/dist/index.js +0 -9
- package/ephemeral/package.json +0 -13
- package/ephemeral/src/index.ts +0 -1
- package/eslint-plugin/src/rules/lifespan.ts +0 -203
- package/immortal/dist/index.d.ts +0 -12
- package/immortal/dist/index.js +0 -9
- package/immortal/package.json +0 -13
- package/immortal/src/index.ts +0 -1
- package/immortal/src/seek-state.ts +0 -60
- /package/{ephemeral/src → src}/find-state.ts +0 -0
|
@@ -17,7 +17,6 @@ import type {
|
|
|
17
17
|
TransactionUpdate,
|
|
18
18
|
TransactionUpdateContent,
|
|
19
19
|
} from "atom.io"
|
|
20
|
-
import { stringifyJson } from "atom.io/json"
|
|
21
20
|
|
|
22
21
|
import { newest } from "../lineage"
|
|
23
22
|
import { getUpdateToken } from "../mutable"
|
|
@@ -78,8 +77,8 @@ export type Timeline<ManagedAtom extends TimelineManageable> = {
|
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
export function createTimeline<ManagedAtom extends TimelineManageable>(
|
|
81
|
-
options: TimelineOptions<ManagedAtom>,
|
|
82
80
|
store: Store,
|
|
81
|
+
options: TimelineOptions<ManagedAtom>,
|
|
83
82
|
data?: Timeline<ManagedAtom>,
|
|
84
83
|
): TimelineToken<ManagedAtom> {
|
|
85
84
|
const tl: Timeline<ManagedAtom> = {
|
|
@@ -92,7 +91,7 @@ export function createTimeline<ManagedAtom extends TimelineManageable>(
|
|
|
92
91
|
transactionKey: null,
|
|
93
92
|
...data,
|
|
94
93
|
history: data?.history.map((update) => ({ ...update })) ?? [],
|
|
95
|
-
install: (s) => createTimeline(
|
|
94
|
+
install: (s) => createTimeline(s, options, tl),
|
|
96
95
|
subject: new Subject(),
|
|
97
96
|
subscriptions: new Map(),
|
|
98
97
|
}
|
|
@@ -131,7 +130,7 @@ export function createTimeline<ManagedAtom extends TimelineManageable>(
|
|
|
131
130
|
)
|
|
132
131
|
continue
|
|
133
132
|
}
|
|
134
|
-
addAtomToTimeline(atomToken, tl
|
|
133
|
+
addAtomToTimeline(store, atomToken, tl)
|
|
135
134
|
}
|
|
136
135
|
break
|
|
137
136
|
|
|
@@ -151,28 +150,9 @@ export function createTimeline<ManagedAtom extends TimelineManageable>(
|
|
|
151
150
|
)
|
|
152
151
|
continue
|
|
153
152
|
}
|
|
154
|
-
addAtomFamilyToTimeline(familyToken, tl
|
|
153
|
+
addAtomFamilyToTimeline(store, familyToken, tl)
|
|
155
154
|
}
|
|
156
155
|
break
|
|
157
|
-
|
|
158
|
-
// case `molecule_family`:
|
|
159
|
-
// {
|
|
160
|
-
// const familyToken: MoleculeFamilyToken<any> = initialTopic
|
|
161
|
-
// const familyKey = familyToken.key
|
|
162
|
-
// const existingTimelineKey =
|
|
163
|
-
// target.timelineTopics.getRelatedKey(familyKey)
|
|
164
|
-
// if (existingTimelineKey) {
|
|
165
|
-
// store.logger.error(
|
|
166
|
-
// `❌`,
|
|
167
|
-
// `timeline`,
|
|
168
|
-
// options.key,
|
|
169
|
-
// `Failed to add molecule family "${familyKey}" because it already belongs to timeline "${existingTimelineKey}"`,
|
|
170
|
-
// )
|
|
171
|
-
// continue
|
|
172
|
-
// }
|
|
173
|
-
// addMoleculeFamilyToTimeline(familyToken, tl, store)
|
|
174
|
-
// }
|
|
175
|
-
// break
|
|
176
156
|
}
|
|
177
157
|
}
|
|
178
158
|
|
|
@@ -186,14 +166,14 @@ export function createTimeline<ManagedAtom extends TimelineManageable>(
|
|
|
186
166
|
}
|
|
187
167
|
|
|
188
168
|
function addAtomToTimeline(
|
|
169
|
+
store: Store,
|
|
189
170
|
atomToken: AtomToken<any>,
|
|
190
171
|
tl: Timeline<any>,
|
|
191
|
-
store: Store,
|
|
192
172
|
): void {
|
|
193
|
-
let maybeAtom = withdraw(
|
|
173
|
+
let maybeAtom = withdraw(store, atomToken)
|
|
194
174
|
if (maybeAtom.type === `mutable_atom`) {
|
|
195
175
|
const updateToken = getUpdateToken(maybeAtom)
|
|
196
|
-
maybeAtom = withdraw(
|
|
176
|
+
maybeAtom = withdraw(store, updateToken)
|
|
197
177
|
}
|
|
198
178
|
const atom = maybeAtom
|
|
199
179
|
store.timelineTopics.set(
|
|
@@ -236,7 +216,7 @@ function addAtomToTimeline(
|
|
|
236
216
|
)
|
|
237
217
|
if (tl.timeTraveling === null) {
|
|
238
218
|
if (txUpdateInProgress) {
|
|
239
|
-
joinTransaction(tl, txUpdateInProgress
|
|
219
|
+
joinTransaction(store, tl, txUpdateInProgress)
|
|
240
220
|
} else if (currentSelectorKey && currentSelectorTime) {
|
|
241
221
|
let latestUpdate: TimelineUpdate<any> | undefined = tl.history.at(-1)
|
|
242
222
|
|
|
@@ -330,11 +310,11 @@ function addAtomToTimeline(
|
|
|
330
310
|
}
|
|
331
311
|
|
|
332
312
|
function addAtomFamilyToTimeline(
|
|
313
|
+
store: Store,
|
|
333
314
|
atomFamilyToken: AtomFamilyToken<any, any>,
|
|
334
315
|
tl: Timeline<any>,
|
|
335
|
-
store: Store,
|
|
336
316
|
): void {
|
|
337
|
-
const family = withdraw(
|
|
317
|
+
const family = withdraw(store, atomFamilyToken)
|
|
338
318
|
store.timelineTopics.set(
|
|
339
319
|
{ topicKey: family.key, timelineKey: tl.key },
|
|
340
320
|
{ topicType: `atom_family` },
|
|
@@ -344,21 +324,21 @@ function addAtomFamilyToTimeline(
|
|
|
344
324
|
family.subject.subscribe(
|
|
345
325
|
`timeline`,
|
|
346
326
|
function timelineCapturesStateLifecycleEvent(creationOrDisposal) {
|
|
347
|
-
handleStateLifecycleEvent(creationOrDisposal, tl
|
|
327
|
+
handleStateLifecycleEvent(store, creationOrDisposal, tl)
|
|
348
328
|
},
|
|
349
329
|
),
|
|
350
330
|
)
|
|
351
331
|
for (const atom of store.atoms.values()) {
|
|
352
332
|
if (atom.family?.key === family.key) {
|
|
353
|
-
addAtomToTimeline(atom, tl
|
|
333
|
+
addAtomToTimeline(store, atom, tl)
|
|
354
334
|
}
|
|
355
335
|
}
|
|
356
336
|
}
|
|
357
337
|
|
|
358
338
|
function joinTransaction(
|
|
339
|
+
store: Store,
|
|
359
340
|
tl: Timeline<any>,
|
|
360
341
|
txUpdateInProgress: TransactionUpdate<Func>,
|
|
361
|
-
store: Store,
|
|
362
342
|
) {
|
|
363
343
|
const currentTxKey = txUpdateInProgress.key
|
|
364
344
|
const currentTxInstanceId = txUpdateInProgress.id
|
|
@@ -366,7 +346,7 @@ function joinTransaction(
|
|
|
366
346
|
key: currentTxKey,
|
|
367
347
|
type: `transaction`,
|
|
368
348
|
}
|
|
369
|
-
const currentTransaction = withdraw(
|
|
349
|
+
const currentTransaction = withdraw(store, currentTxToken)
|
|
370
350
|
if (currentTxKey && tl.transactionKey === null) {
|
|
371
351
|
tl.transactionKey = currentTxKey
|
|
372
352
|
const unsubscribe = currentTransaction.subject.subscribe(
|
|
@@ -453,9 +433,9 @@ function filterTransactionUpdates(
|
|
|
453
433
|
}
|
|
454
434
|
|
|
455
435
|
function handleStateLifecycleEvent(
|
|
436
|
+
store: Store,
|
|
456
437
|
event: StateCreation<any> | StateDisposal<any>,
|
|
457
438
|
tl: Timeline<any>,
|
|
458
|
-
store: Store,
|
|
459
439
|
): void {
|
|
460
440
|
const timestamp = Date.now()
|
|
461
441
|
const timelineEvent = Object.assign(event, {
|
|
@@ -468,7 +448,7 @@ function handleStateLifecycleEvent(
|
|
|
468
448
|
} else {
|
|
469
449
|
const txUpdateInProgress = target.on.transactionApplying.state
|
|
470
450
|
if (txUpdateInProgress) {
|
|
471
|
-
joinTransaction(tl, txUpdateInProgress.update
|
|
451
|
+
joinTransaction(store, tl, txUpdateInProgress.update)
|
|
472
452
|
} else {
|
|
473
453
|
tl.history.push(timelineEvent)
|
|
474
454
|
tl.at = tl.history.length
|
|
@@ -478,7 +458,7 @@ function handleStateLifecycleEvent(
|
|
|
478
458
|
}
|
|
479
459
|
switch (event.type) {
|
|
480
460
|
case `state_creation`:
|
|
481
|
-
addAtomToTimeline(event.token, tl
|
|
461
|
+
addAtomToTimeline(store, event.token, tl)
|
|
482
462
|
break
|
|
483
463
|
case `state_disposal`:
|
|
484
464
|
tl.subscriptions.get(event.token.key)?.()
|
|
@@ -6,12 +6,12 @@ import { withdraw } from "../store"
|
|
|
6
6
|
import type { Func } from "../utility-types"
|
|
7
7
|
|
|
8
8
|
export function actUponStore<F extends Func>(
|
|
9
|
+
store: Store,
|
|
9
10
|
token: TransactionToken<F>,
|
|
10
11
|
id: string,
|
|
11
|
-
store: Store,
|
|
12
12
|
): (...parameters: Parameters<F>) => ReturnType<F> {
|
|
13
13
|
return (...parameters: Parameters<F>): ReturnType<F> => {
|
|
14
|
-
const tx = withdraw(
|
|
14
|
+
const tx = withdraw(store, token)
|
|
15
15
|
if (tx) {
|
|
16
16
|
return tx.run(parameters, id)
|
|
17
17
|
}
|
|
@@ -42,14 +42,14 @@ export const applyTransaction = <F extends Func>(
|
|
|
42
42
|
|
|
43
43
|
if (isRootStore(parent)) {
|
|
44
44
|
setEpochNumberOfAction(
|
|
45
|
+
parent,
|
|
45
46
|
child.transactionMeta.update.key,
|
|
46
47
|
child.transactionMeta.update.epoch,
|
|
47
|
-
parent,
|
|
48
|
-
)
|
|
49
|
-
const myTransaction = withdraw<F>(
|
|
50
|
-
{ key: child.transactionMeta.update.key, type: `transaction` },
|
|
51
|
-
store,
|
|
52
48
|
)
|
|
49
|
+
const myTransaction = withdraw<F>(store, {
|
|
50
|
+
key: child.transactionMeta.update.key,
|
|
51
|
+
type: `transaction`,
|
|
52
|
+
})
|
|
53
53
|
myTransaction?.subject.next(child.transactionMeta.update)
|
|
54
54
|
store.logger.info(
|
|
55
55
|
`🛬`,
|
|
@@ -2,9 +2,9 @@ import type { Store } from "../store"
|
|
|
2
2
|
import { isRootStore } from "./is-root-store"
|
|
3
3
|
|
|
4
4
|
export function assignTransactionToContinuity(
|
|
5
|
+
store: Store,
|
|
5
6
|
continuityKey: string,
|
|
6
7
|
transactionKey: string,
|
|
7
|
-
store: Store,
|
|
8
8
|
): void {
|
|
9
9
|
const isRoot = isRootStore(store)
|
|
10
10
|
if (!isRoot) {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { disposeState, getState, setState } from "atom.io"
|
|
2
|
-
import type { findState } from "atom.io/ephemeral"
|
|
3
|
-
import type { seekState } from "atom.io/immortal"
|
|
1
|
+
import type { disposeState, findState, getState, setState } from "atom.io"
|
|
4
2
|
|
|
5
3
|
import { arbitrary } from "../arbitrary"
|
|
6
|
-
import { disposeFromStore, findInStore
|
|
4
|
+
import { disposeFromStore, findInStore } from "../families"
|
|
7
5
|
import { getEnvironmentData } from "../get-environment-data"
|
|
8
6
|
import { getFromStore } from "../get-state"
|
|
9
7
|
import { Junction } from "../junction"
|
|
@@ -18,9 +16,9 @@ import { actUponStore, getEpochNumberOfAction } from "."
|
|
|
18
16
|
import type { ChildStore, RootStore } from "./is-root-store"
|
|
19
17
|
|
|
20
18
|
export const buildTransaction = (
|
|
19
|
+
store: Store,
|
|
21
20
|
key: string,
|
|
22
21
|
params: any[],
|
|
23
|
-
store: Store,
|
|
24
22
|
id: string,
|
|
25
23
|
): ChildStore => {
|
|
26
24
|
const parent = newest(store) as ChildStore | RootStore
|
|
@@ -61,7 +59,7 @@ export const buildTransaction = (
|
|
|
61
59
|
}),
|
|
62
60
|
miscResources: new LazyMap(parent.miscResources),
|
|
63
61
|
}
|
|
64
|
-
const epoch = getEpochNumberOfAction(
|
|
62
|
+
const epoch = getEpochNumberOfAction(store, key)
|
|
65
63
|
const transactionMeta: TransactionProgress<Func> = {
|
|
66
64
|
phase: `building`,
|
|
67
65
|
update: {
|
|
@@ -80,9 +78,8 @@ export const buildTransaction = (
|
|
|
80
78
|
setIntoStore(child, ...ps)
|
|
81
79
|
}) as typeof setState,
|
|
82
80
|
run: (token, identifier = arbitrary()) =>
|
|
83
|
-
actUponStore(token, identifier
|
|
81
|
+
actUponStore(child, token, identifier),
|
|
84
82
|
find: ((token, k) => findInStore(child, token, k)) as typeof findState,
|
|
85
|
-
seek: ((token, k) => seekInStore(child, token, k)) as typeof seekState,
|
|
86
83
|
json: (token) => getJsonToken(child, token),
|
|
87
84
|
dispose: ((...ps: Parameters<typeof disposeState>) => {
|
|
88
85
|
disposeFromStore(child, ...ps)
|
|
@@ -22,14 +22,14 @@ export type Transaction<F extends Func> = {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export function createTransaction<F extends Func>(
|
|
25
|
-
options: TransactionOptions<F>,
|
|
26
25
|
store: Store,
|
|
26
|
+
options: TransactionOptions<F>,
|
|
27
27
|
): TransactionToken<F> {
|
|
28
28
|
const newTransaction: Transaction<F> = {
|
|
29
29
|
key: options.key,
|
|
30
30
|
type: `transaction`,
|
|
31
31
|
run: (params: Parameters<F>, id: string) => {
|
|
32
|
-
const childStore = buildTransaction(options.key, params,
|
|
32
|
+
const childStore = buildTransaction(store, options.key, params, id)
|
|
33
33
|
try {
|
|
34
34
|
const target = newest(store)
|
|
35
35
|
const { toolkit } = childStore.transactionMeta
|
|
@@ -42,7 +42,7 @@ export function createTransaction<F extends Func>(
|
|
|
42
42
|
throw thrown
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
install: (s) => createTransaction(
|
|
45
|
+
install: (s) => createTransaction(s, options),
|
|
46
46
|
subject: new Subject(),
|
|
47
47
|
}
|
|
48
48
|
const target = newest(store)
|
|
@@ -2,8 +2,8 @@ import type { Store } from "../store"
|
|
|
2
2
|
import { isRootStore } from "./is-root-store"
|
|
3
3
|
|
|
4
4
|
export function getContinuityKey(
|
|
5
|
-
transactionKey: string,
|
|
6
5
|
store: Store,
|
|
6
|
+
transactionKey: string,
|
|
7
7
|
): string | undefined {
|
|
8
8
|
const isRoot = isRootStore(store)
|
|
9
9
|
const continuity = isRoot
|
|
@@ -13,8 +13,8 @@ export function getContinuityKey(
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function getEpochNumberOfContinuity(
|
|
16
|
-
continuityKey: string,
|
|
17
16
|
store: Store,
|
|
17
|
+
continuityKey: string,
|
|
18
18
|
): number | undefined {
|
|
19
19
|
const isRoot = isRootStore(store)
|
|
20
20
|
const epoch =
|
|
@@ -25,8 +25,8 @@ export function getEpochNumberOfContinuity(
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export function getEpochNumberOfAction(
|
|
28
|
-
transactionKey: string,
|
|
29
28
|
store: Store,
|
|
29
|
+
transactionKey: string,
|
|
30
30
|
): number | undefined {
|
|
31
31
|
const isRoot = isRootStore(store)
|
|
32
32
|
const continuity = isRoot
|
|
@@ -2,9 +2,9 @@ import type { Store } from "../store"
|
|
|
2
2
|
import { isRootStore } from "./is-root-store"
|
|
3
3
|
|
|
4
4
|
export function setEpochNumberOfContinuity(
|
|
5
|
+
store: Store,
|
|
5
6
|
continuityKey: string,
|
|
6
7
|
newEpoch: number,
|
|
7
|
-
store: Store,
|
|
8
8
|
): void {
|
|
9
9
|
const isRoot = isRootStore(store)
|
|
10
10
|
if (isRoot && continuityKey) {
|
|
@@ -13,9 +13,9 @@ export function setEpochNumberOfContinuity(
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function setEpochNumberOfAction(
|
|
16
|
+
store: Store,
|
|
16
17
|
transactionKey: string,
|
|
17
18
|
newEpoch: number,
|
|
18
|
-
store: Store,
|
|
19
19
|
): void {
|
|
20
20
|
const isRoot = isRootStore(store)
|
|
21
21
|
if (!isRoot) {
|