xstate 6.0.0-alpha.65 → 6.0.0-alpha.66
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/README.md +3 -3
- package/dist/{createActor-4629a290.esm.js → createActor-18a56099.esm.js} +130 -189
- package/dist/{createActor-b987e971.cjs.js → createActor-19ee5e3c.cjs.js} +130 -189
- package/dist/{createActor-8f57b47b.development.esm.js → createActor-57ac74ac.development.esm.js} +130 -225
- package/dist/{createActor-1df42c9e.development.cjs.js → createActor-ff6a685e.development.cjs.js} +130 -225
- package/dist/declarations/src/StateMachine.d.ts +2 -3
- package/dist/declarations/src/index.d.ts +1 -1
- package/dist/declarations/src/transitionActions.d.ts +1 -1
- package/dist/declarations/src/types.d.ts +4 -4
- package/dist/declarations/src/types.v6.d.ts +1 -0
- package/dist/{effectDescriptor-4cf24593.cjs.js → effectDescriptor-515bb8bd.cjs.js} +1 -1
- package/dist/{effectDescriptor-973fc1ba.esm.js → effectDescriptor-c96275e6.esm.js} +1 -1
- package/dist/{effectDescriptor-b2b7deaa.development.cjs.js → effectDescriptor-d941b462.development.cjs.js} +1 -1
- package/dist/{effectDescriptor-c4671afc.development.esm.js → effectDescriptor-f87ea294.development.esm.js} +1 -1
- package/dist/{index-0cf33789.development.cjs.js → index-66c07691.development.cjs.js} +1 -1
- package/dist/{index-f201d440.cjs.js → index-72e3c72c.cjs.js} +1 -1
- package/dist/{index-15382daf.development.esm.js → index-b0b89ca7.development.esm.js} +1 -1
- package/dist/{index-52ad3d45.esm.js → index-e540ddba.esm.js} +1 -1
- package/dist/xstate-actors.cjs.js +2 -2
- package/dist/xstate-actors.development.cjs.js +2 -2
- package/dist/xstate-actors.development.esm.js +2 -2
- package/dist/xstate-actors.esm.js +2 -2
- package/dist/xstate-actors.umd.min.js +1 -1
- package/dist/xstate-actors.umd.min.js.map +1 -1
- package/dist/xstate-durable.cjs.js +2 -2
- package/dist/xstate-durable.development.cjs.js +2 -2
- package/dist/xstate-durable.development.esm.js +2 -2
- package/dist/xstate-durable.esm.js +2 -2
- package/dist/xstate-durable.umd.min.js +1 -1
- package/dist/xstate-durable.umd.min.js.map +1 -1
- package/dist/xstate-graph.cjs.js +2 -2
- package/dist/xstate-graph.development.cjs.js +2 -2
- package/dist/xstate-graph.development.esm.js +3 -3
- package/dist/xstate-graph.esm.js +3 -3
- package/dist/xstate-graph.umd.min.js +1 -1
- package/dist/xstate-graph.umd.min.js.map +1 -1
- package/dist/xstate-validation.cjs.js +1 -1
- package/dist/xstate-validation.development.cjs.js +1 -1
- package/dist/xstate-validation.development.esm.js +1 -1
- package/dist/xstate-validation.esm.js +1 -1
- package/dist/xstate.cjs.js +3 -11
- package/dist/xstate.development.cjs.js +3 -11
- package/dist/xstate.development.esm.js +5 -13
- package/dist/xstate.esm.js +5 -13
- package/dist/xstate.umd.min.js +1 -1
- package/dist/xstate.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -453,81 +453,6 @@ function createSubscriptionLogic() {
|
|
|
453
453
|
/** @public */
|
|
454
454
|
const subscriptionLogic = /* #__PURE__ */createSubscriptionLogic();
|
|
455
455
|
|
|
456
|
-
/** Marks the internal lazy scope without imposing structure on custom runtimes. @internal */
|
|
457
|
-
const lazyActorScope = Symbol();
|
|
458
|
-
/** Whether actor capabilities are represented by a lazy pure-transition scope. @internal */
|
|
459
|
-
function isLazyActorScope(actorScope) {
|
|
460
|
-
return !!actorScope[lazyActorScope];
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/** Reads parent metadata without otherwise touching actor capabilities. @internal */
|
|
464
|
-
function getActorScopeParent(actorScope) {
|
|
465
|
-
return isLazyActorScope(actorScope) ? actorScope._parent : actorScope.self._parent;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
/** Adds only `self`, preserving callback surfaces that expose no other capabilities. @internal */
|
|
469
|
-
function withActorSelf(args, actorScope) {
|
|
470
|
-
if (!isLazyActorScope(actorScope)) {
|
|
471
|
-
return Object.assign(args, {
|
|
472
|
-
self: actorScope.self
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
Object.defineProperty(args, 'self', {
|
|
476
|
-
enumerable: true,
|
|
477
|
-
get: () => actorScope.self
|
|
478
|
-
});
|
|
479
|
-
return args;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/** Adds the actor reference and parent without exposing the system. @internal */
|
|
483
|
-
function withActorSelfAndParent(args, actorScope) {
|
|
484
|
-
if (!isLazyActorScope(actorScope)) {
|
|
485
|
-
const self = actorScope.self;
|
|
486
|
-
return Object.assign(args, {
|
|
487
|
-
self,
|
|
488
|
-
parent: self._parent
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
Object.defineProperties(args, {
|
|
492
|
-
self: {
|
|
493
|
-
enumerable: true,
|
|
494
|
-
get: () => actorScope.self
|
|
495
|
-
},
|
|
496
|
-
parent: {
|
|
497
|
-
enumerable: true,
|
|
498
|
-
get: () => getActorScopeParent(actorScope)
|
|
499
|
-
}
|
|
500
|
-
});
|
|
501
|
-
return args;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
/** Adds actor capabilities without reading them until the callback does. @internal */
|
|
505
|
-
function withActorScope(args, actorScope) {
|
|
506
|
-
if (!isLazyActorScope(actorScope)) {
|
|
507
|
-
const actorArgs = args;
|
|
508
|
-
const self = actorScope.self;
|
|
509
|
-
actorArgs.self = self;
|
|
510
|
-
actorArgs.system = actorScope.system;
|
|
511
|
-
actorArgs.parent = self._parent;
|
|
512
|
-
return actorArgs;
|
|
513
|
-
}
|
|
514
|
-
Object.defineProperties(args, {
|
|
515
|
-
self: {
|
|
516
|
-
enumerable: true,
|
|
517
|
-
get: () => actorScope.self
|
|
518
|
-
},
|
|
519
|
-
system: {
|
|
520
|
-
enumerable: true,
|
|
521
|
-
get: () => actorScope.system
|
|
522
|
-
},
|
|
523
|
-
parent: {
|
|
524
|
-
enumerable: true,
|
|
525
|
-
get: () => getActorScopeParent(actorScope)
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
return args;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
456
|
function execCustomEffect() {
|
|
532
457
|
const result = this.action?.(...this.args);
|
|
533
458
|
return result;
|
|
@@ -1318,28 +1243,10 @@ async function executeEffects(effects, runtime) {
|
|
|
1318
1243
|
await effect.exec(runtime);
|
|
1319
1244
|
}
|
|
1320
1245
|
}
|
|
1321
|
-
function resolveActionsWithContext(currentSnapshot,
|
|
1246
|
+
function resolveActionsWithContext(currentSnapshot, _event, actorScope, actions) {
|
|
1322
1247
|
let intermediateSnapshot = currentSnapshot;
|
|
1323
1248
|
const executableActions = [];
|
|
1324
1249
|
for (const action of actions) {
|
|
1325
|
-
const actionArgs = isLazyActorScope(actorScope) ? withActorScope({
|
|
1326
|
-
context: intermediateSnapshot.context,
|
|
1327
|
-
event,
|
|
1328
|
-
output: getEventOutput(event),
|
|
1329
|
-
children: intermediateSnapshot.children,
|
|
1330
|
-
actions: currentSnapshot.machine.sources.actions,
|
|
1331
|
-
actors: currentSnapshot.machine.sources.actors
|
|
1332
|
-
}, actorScope) : {
|
|
1333
|
-
context: intermediateSnapshot.context,
|
|
1334
|
-
event,
|
|
1335
|
-
output: getEventOutput(event),
|
|
1336
|
-
self: actorScope.self,
|
|
1337
|
-
system: actorScope.system,
|
|
1338
|
-
parent: actorScope.self._parent,
|
|
1339
|
-
children: intermediateSnapshot.children,
|
|
1340
|
-
actions: currentSnapshot.machine.sources.actions,
|
|
1341
|
-
actors: currentSnapshot.machine.sources.actors
|
|
1342
|
-
};
|
|
1343
1250
|
const isInline = typeof action === 'function';
|
|
1344
1251
|
const actionRecord = getTransitionActionRecord(action);
|
|
1345
1252
|
let resolvedActionArgs = actionRecord?.args;
|
|
@@ -1367,33 +1274,6 @@ function resolveActionsWithContext(currentSnapshot, event, actorScope, actions)
|
|
|
1367
1274
|
if (actionRecord?.childUpdate) {
|
|
1368
1275
|
intermediateSnapshot = applyChildUpdate(intermediateSnapshot, actionRecord.childUpdate, actorScope);
|
|
1369
1276
|
}
|
|
1370
|
-
if (resolvedAction && '_special' in resolvedAction) {
|
|
1371
|
-
executableActions.push({
|
|
1372
|
-
kind: 'action',
|
|
1373
|
-
exec: execCustomEffect,
|
|
1374
|
-
type: typeof action === 'object' ? 'action' in action && typeof action.action === 'function' ? action.action.name ?? '(anonymous)' : action.type ?? '(anonymous)' : action.name || '(anonymous)',
|
|
1375
|
-
params: actionParams,
|
|
1376
|
-
args: [],
|
|
1377
|
-
action: undefined
|
|
1378
|
-
});
|
|
1379
|
-
const specialAction = resolvedAction;
|
|
1380
|
-
const res = specialAction(actionArgs, emptyEnqueueObject);
|
|
1381
|
-
if (res && ('context' in res || 'children' in res)) {
|
|
1382
|
-
// Special-action patches never change `nodes`, so a shallow clone is
|
|
1383
|
-
// equivalent to `cloneMachineSnapshot` — and keeps this module (and
|
|
1384
|
-
// non-machine logic like `createFSM`) independent of State.ts.
|
|
1385
|
-
intermediateSnapshot = {
|
|
1386
|
-
...intermediateSnapshot,
|
|
1387
|
-
...(res.context !== undefined ? {
|
|
1388
|
-
context: mergeContextPatch(intermediateSnapshot.context, res.context)
|
|
1389
|
-
} : {}),
|
|
1390
|
-
...('children' in res ? {
|
|
1391
|
-
children: res.children
|
|
1392
|
-
} : {})
|
|
1393
|
-
};
|
|
1394
|
-
}
|
|
1395
|
-
continue;
|
|
1396
|
-
}
|
|
1397
1277
|
if (!resolvedAction || !('resolve' in resolvedAction)) {
|
|
1398
1278
|
const builtInFields = typeof action === 'object' && action !== null && 'action' in action && typeof action.action === 'function' ? getBuiltInActionFields(action.action, resolvedActionArgs) : undefined;
|
|
1399
1279
|
const isEmittedEvent = typeof action === 'object' && action !== null && !actionRecord;
|
|
@@ -1441,7 +1321,6 @@ function createEnqueueObject(props, action) {
|
|
|
1441
1321
|
}
|
|
1442
1322
|
const noop = () => {};
|
|
1443
1323
|
const emptyActor = () => ({});
|
|
1444
|
-
const emptyEnqueueObject = createEnqueueObject({}, noop);
|
|
1445
1324
|
|
|
1446
1325
|
function parseDurationToMilliseconds(duration) {
|
|
1447
1326
|
const normalizedDuration = duration.trim();
|
|
@@ -1773,6 +1652,81 @@ function setSnapshotActorRef(snapshot, actor, baseSystem = actor.system, previou
|
|
|
1773
1652
|
});
|
|
1774
1653
|
}
|
|
1775
1654
|
|
|
1655
|
+
/** Marks the internal lazy scope without imposing structure on custom runtimes. @internal */
|
|
1656
|
+
const lazyActorScope = Symbol();
|
|
1657
|
+
/** Whether actor capabilities are represented by a lazy pure-transition scope. @internal */
|
|
1658
|
+
function isLazyActorScope(actorScope) {
|
|
1659
|
+
return !!actorScope[lazyActorScope];
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/** Reads parent metadata without otherwise touching actor capabilities. @internal */
|
|
1663
|
+
function getActorScopeParent(actorScope) {
|
|
1664
|
+
return isLazyActorScope(actorScope) ? actorScope._parent : actorScope.self._parent;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
/** Adds only `self`, preserving callback surfaces that expose no other capabilities. @internal */
|
|
1668
|
+
function withActorSelf(args, actorScope) {
|
|
1669
|
+
if (!isLazyActorScope(actorScope)) {
|
|
1670
|
+
return Object.assign(args, {
|
|
1671
|
+
self: actorScope.self
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
Object.defineProperty(args, 'self', {
|
|
1675
|
+
enumerable: true,
|
|
1676
|
+
get: () => actorScope.self
|
|
1677
|
+
});
|
|
1678
|
+
return args;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
/** Adds the actor reference and parent without exposing the system. @internal */
|
|
1682
|
+
function withActorSelfAndParent(args, actorScope) {
|
|
1683
|
+
if (!isLazyActorScope(actorScope)) {
|
|
1684
|
+
const self = actorScope.self;
|
|
1685
|
+
return Object.assign(args, {
|
|
1686
|
+
self,
|
|
1687
|
+
parent: self._parent
|
|
1688
|
+
});
|
|
1689
|
+
}
|
|
1690
|
+
Object.defineProperties(args, {
|
|
1691
|
+
self: {
|
|
1692
|
+
enumerable: true,
|
|
1693
|
+
get: () => actorScope.self
|
|
1694
|
+
},
|
|
1695
|
+
parent: {
|
|
1696
|
+
enumerable: true,
|
|
1697
|
+
get: () => getActorScopeParent(actorScope)
|
|
1698
|
+
}
|
|
1699
|
+
});
|
|
1700
|
+
return args;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
/** Adds actor capabilities without reading them until the callback does. @internal */
|
|
1704
|
+
function withActorScope(args, actorScope) {
|
|
1705
|
+
if (!isLazyActorScope(actorScope)) {
|
|
1706
|
+
const actorArgs = args;
|
|
1707
|
+
const self = actorScope.self;
|
|
1708
|
+
actorArgs.self = self;
|
|
1709
|
+
actorArgs.system = actorScope.system;
|
|
1710
|
+
actorArgs.parent = self._parent;
|
|
1711
|
+
return actorArgs;
|
|
1712
|
+
}
|
|
1713
|
+
Object.defineProperties(args, {
|
|
1714
|
+
self: {
|
|
1715
|
+
enumerable: true,
|
|
1716
|
+
get: () => actorScope.self
|
|
1717
|
+
},
|
|
1718
|
+
system: {
|
|
1719
|
+
enumerable: true,
|
|
1720
|
+
get: () => actorScope.system
|
|
1721
|
+
},
|
|
1722
|
+
parent: {
|
|
1723
|
+
enumerable: true,
|
|
1724
|
+
get: () => getActorScopeParent(actorScope)
|
|
1725
|
+
}
|
|
1726
|
+
});
|
|
1727
|
+
return args;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1776
1730
|
/** @internal */
|
|
1777
1731
|
function setInertActorScopeSnapshot(actorScope, snapshot, attachActorRef = true) {
|
|
1778
1732
|
const lazyState = getLazyInertActorState(actorScope);
|
|
@@ -2859,75 +2813,47 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
2859
2813
|
return !!targets?.length || !!reenter;
|
|
2860
2814
|
});
|
|
2861
2815
|
const getStateActionsAndContext = (transitionFn, context, children, input, kind, stateNode) => {
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
actors: currentSnapshot.machine.sources.actors,
|
|
2874
|
-
guards: currentSnapshot.machine.sources.guards,
|
|
2875
|
-
delays: currentSnapshot.machine.sources.delays,
|
|
2876
|
-
input,
|
|
2877
|
-
stateNode
|
|
2878
|
-
}, actorScope) : {
|
|
2879
|
-
context,
|
|
2880
|
-
event,
|
|
2881
|
-
parent: actorScope.self._parent,
|
|
2882
|
-
self: actorScope.self,
|
|
2883
|
-
children,
|
|
2884
|
-
system: actorScope.system,
|
|
2885
|
-
actions: currentSnapshot.machine.sources.actions,
|
|
2886
|
-
actors: currentSnapshot.machine.sources.actors,
|
|
2887
|
-
guards: currentSnapshot.machine.sources.guards,
|
|
2888
|
-
delays: currentSnapshot.machine.sources.delays,
|
|
2889
|
-
input,
|
|
2890
|
-
stateNode
|
|
2891
|
-
};
|
|
2892
|
-
let res;
|
|
2893
|
-
try {
|
|
2894
|
-
res = transitionFn(args, enqueue);
|
|
2895
|
-
} finally {
|
|
2896
|
-
closeTransitionEnqueue(enqueue);
|
|
2897
|
-
}
|
|
2898
|
-
assertSyncTransitionResult(res, event, stateNode.id, kind);
|
|
2899
|
-
if (res?.context !== undefined) {
|
|
2900
|
-
updatedContext = mergeContextPatch(context, res.context);
|
|
2901
|
-
}
|
|
2902
|
-
return [actions, updatedContext, internalEvents];
|
|
2903
|
-
}
|
|
2904
|
-
|
|
2905
|
-
// For 1-argument actions, wrap them to include input
|
|
2906
|
-
// Preserve _special flag if present (for entry/exit actions)
|
|
2907
|
-
const wrappedAction = Object.assign((args, enqueue) => transitionFn(isLazyActorScope(actorScope) ? withActorScope({
|
|
2908
|
-
context: args.context,
|
|
2909
|
-
event: args.event,
|
|
2910
|
-
output: args.output,
|
|
2911
|
-
children: args.children,
|
|
2912
|
-
actions: args.actions,
|
|
2913
|
-
actors: args.actors,
|
|
2816
|
+
const actions = [];
|
|
2817
|
+
const internalEvents = [];
|
|
2818
|
+
let updatedContext;
|
|
2819
|
+
const enqueue = createTransitionEnqueue(actorScope, actions, internalEvents, true);
|
|
2820
|
+
const args = isLazyActorScope(actorScope) ? withActorScope({
|
|
2821
|
+
context,
|
|
2822
|
+
event,
|
|
2823
|
+
output: getEventOutput(event),
|
|
2824
|
+
children,
|
|
2825
|
+
actions: currentSnapshot.machine.sources.actions,
|
|
2826
|
+
actors: currentSnapshot.machine.sources.actors,
|
|
2914
2827
|
guards: currentSnapshot.machine.sources.guards,
|
|
2915
2828
|
delays: currentSnapshot.machine.sources.delays,
|
|
2916
2829
|
input,
|
|
2917
2830
|
stateNode
|
|
2918
2831
|
}, actorScope) : {
|
|
2919
|
-
|
|
2832
|
+
context,
|
|
2833
|
+
event,
|
|
2834
|
+
output: getEventOutput(event),
|
|
2835
|
+
parent: actorScope.self._parent,
|
|
2836
|
+
self: actorScope.self,
|
|
2837
|
+
children,
|
|
2838
|
+
system: actorScope.system,
|
|
2839
|
+
actions: currentSnapshot.machine.sources.actions,
|
|
2840
|
+
actors: currentSnapshot.machine.sources.actors,
|
|
2920
2841
|
guards: currentSnapshot.machine.sources.guards,
|
|
2921
2842
|
delays: currentSnapshot.machine.sources.delays,
|
|
2922
2843
|
input,
|
|
2923
2844
|
stateNode
|
|
2924
|
-
}
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2845
|
+
};
|
|
2846
|
+
let res;
|
|
2847
|
+
try {
|
|
2848
|
+
res = transitionFn(args, enqueue);
|
|
2849
|
+
} finally {
|
|
2850
|
+
closeTransitionEnqueue(enqueue);
|
|
2851
|
+
}
|
|
2852
|
+
assertSyncTransitionResult(res, event, stateNode.id, kind);
|
|
2853
|
+
if (res?.context !== undefined) {
|
|
2854
|
+
updatedContext = mergeContextPatch(context, res.context);
|
|
2855
|
+
}
|
|
2856
|
+
return [actions, updatedContext, internalEvents, res?.children];
|
|
2931
2857
|
};
|
|
2932
2858
|
let nextState = currentSnapshot;
|
|
2933
2859
|
const getInvokeStopActions = (stateNode, children) => {
|
|
@@ -2962,13 +2888,18 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
2962
2888
|
}
|
|
2963
2889
|
for (const exitStateNode of statesToExit) {
|
|
2964
2890
|
const stateInput = getStateInput(currentSnapshot, exitStateNode.id);
|
|
2965
|
-
const [exitActions, nextContext, internalEvents] = exitStateNode.exit ? getStateActionsAndContext(exitStateNode.exit, nextState.context, nextState.children, stateInput, 'exit', exitStateNode) : [[], undefined, undefined];
|
|
2891
|
+
const [exitActions, nextContext, internalEvents, nextChildren] = exitStateNode.exit ? getStateActionsAndContext(exitStateNode.exit, nextState.context, nextState.children, stateInput, 'exit', exitStateNode) : [[], undefined, undefined, undefined];
|
|
2966
2892
|
if (internalEvents?.length) {
|
|
2967
2893
|
internalQueue.push(...internalEvents);
|
|
2968
2894
|
}
|
|
2969
|
-
if (nextContext) {
|
|
2895
|
+
if (nextContext || nextChildren) {
|
|
2970
2896
|
nextState = cloneMachineSnapshot(nextState, {
|
|
2971
|
-
|
|
2897
|
+
...(nextContext ? {
|
|
2898
|
+
context: nextContext
|
|
2899
|
+
} : {}),
|
|
2900
|
+
...(nextChildren ? {
|
|
2901
|
+
children: nextChildren
|
|
2902
|
+
} : {})
|
|
2972
2903
|
});
|
|
2973
2904
|
}
|
|
2974
2905
|
const [resolvedState, resolvedActions] = resolveActionsWithContext(nextState, event, actorScope, exitActions);
|
|
@@ -3229,7 +3160,7 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
3229
3160
|
let contextChangedByEntry = false;
|
|
3230
3161
|
const stateInput = stateInputMap[stateNodeToEnter.id];
|
|
3231
3162
|
if (stateNodeToEnter.entry) {
|
|
3232
|
-
const [resultActions, nextContext, nextInternalEvents] = getStateActionsAndContext(stateNodeToEnter.entry, context, children, stateInput, 'entry', stateNodeToEnter);
|
|
3163
|
+
const [resultActions, nextContext, nextInternalEvents, nextChildren] = getStateActionsAndContext(stateNodeToEnter.entry, context, children, stateInput, 'entry', stateNodeToEnter);
|
|
3233
3164
|
actions.push(...resultActions);
|
|
3234
3165
|
if (nextInternalEvents?.length) {
|
|
3235
3166
|
internalQueue.push(...nextInternalEvents);
|
|
@@ -3238,6 +3169,11 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
3238
3169
|
context = nextContext;
|
|
3239
3170
|
contextChangedByEntry = true;
|
|
3240
3171
|
}
|
|
3172
|
+
if (nextChildren) {
|
|
3173
|
+
nextState = cloneMachineSnapshot(nextState, {
|
|
3174
|
+
children: nextChildren
|
|
3175
|
+
});
|
|
3176
|
+
}
|
|
3241
3177
|
}
|
|
3242
3178
|
if (contextChangedByEntry) {
|
|
3243
3179
|
nextState.context = context;
|
|
@@ -3337,10 +3273,15 @@ function microstep(transitions, currentSnapshot, actorScope, event, isInitial, i
|
|
|
3337
3273
|
nextStateNodesToExit.forEach(stateNode => {
|
|
3338
3274
|
if (stateNode.exit) {
|
|
3339
3275
|
const stateInput = getStateInput(nextState, stateNode.id);
|
|
3340
|
-
const [exitActions, nextContext, nextInternalEvents] = getStateActionsAndContext(stateNode.exit, nextState.context, nextState.children, stateInput, 'exit', stateNode);
|
|
3341
|
-
if (nextContext) {
|
|
3276
|
+
const [exitActions, nextContext, nextInternalEvents, nextChildren] = getStateActionsAndContext(stateNode.exit, nextState.context, nextState.children, stateInput, 'exit', stateNode);
|
|
3277
|
+
if (nextContext || nextChildren) {
|
|
3342
3278
|
nextState = cloneMachineSnapshot(nextState, {
|
|
3343
|
-
|
|
3279
|
+
...(nextContext ? {
|
|
3280
|
+
context: nextContext
|
|
3281
|
+
} : {}),
|
|
3282
|
+
...(nextChildren ? {
|
|
3283
|
+
children: nextChildren
|
|
3284
|
+
} : {})
|
|
3344
3285
|
});
|
|
3345
3286
|
}
|
|
3346
3287
|
allExitActions.push(...exitActions);
|