xstate 5.0.0-beta.50 → 5.0.0-beta.51
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/actions/dist/xstate-actions.cjs.js +11 -10
- package/actions/dist/xstate-actions.cjs.mjs +1 -0
- package/actions/dist/xstate-actions.development.cjs.js +11 -10
- package/actions/dist/xstate-actions.development.cjs.mjs +1 -0
- package/actions/dist/xstate-actions.development.esm.js +2 -2
- package/actions/dist/xstate-actions.esm.js +2 -2
- package/actions/dist/xstate-actions.umd.min.js +1 -1
- package/actions/dist/xstate-actions.umd.min.js.map +1 -1
- package/actors/dist/xstate-actors.cjs.js +1 -1
- package/actors/dist/xstate-actors.development.cjs.js +1 -1
- package/actors/dist/xstate-actors.development.esm.js +1 -1
- package/actors/dist/xstate-actors.esm.js +1 -1
- package/actors/dist/xstate-actors.umd.min.js.map +1 -1
- package/dist/declarations/src/actions/enqueueActions.d.ts +32 -0
- package/dist/declarations/src/actions/pure.d.ts +7 -10
- package/dist/declarations/src/actions.d.ts +3 -2
- package/dist/declarations/src/utils.d.ts +1 -20
- package/dist/{send-2b001f05.development.esm.js → pure-296f8ebd.development.esm.js} +113 -71
- package/dist/{send-df1c8ef2.development.cjs.js → pure-a0f16134.development.cjs.js} +113 -70
- package/dist/{send-88351a33.esm.js → pure-aefddc19.esm.js} +107 -65
- package/dist/{send-7f3db830.cjs.js → pure-c5f1b46c.cjs.js} +107 -64
- package/dist/{raise-32ec7226.esm.js → raise-4742bf04.esm.js} +7 -12
- package/dist/{raise-dc9c2c58.development.cjs.js → raise-528386de.development.cjs.js} +6 -11
- package/dist/{raise-6c05c91b.development.esm.js → raise-acaa3884.development.esm.js} +7 -12
- package/dist/{raise-8176cd35.cjs.js → raise-d5633a02.cjs.js} +6 -11
- package/dist/xstate.cjs.js +13 -12
- package/dist/xstate.cjs.mjs +1 -0
- package/dist/xstate.development.cjs.js +13 -12
- package/dist/xstate.development.cjs.mjs +1 -0
- package/dist/xstate.development.esm.js +4 -4
- package/dist/xstate.esm.js +4 -4
- package/dist/xstate.umd.min.js +1 -1
- package/dist/xstate.umd.min.js.map +1 -1
- package/guards/dist/xstate-guards.cjs.js +1 -1
- package/guards/dist/xstate-guards.development.cjs.js +1 -1
- package/guards/dist/xstate-guards.development.esm.js +1 -1
- package/guards/dist/xstate-guards.esm.js +1 -1
- package/guards/dist/xstate-guards.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
3
|
+
var guards_dist_xstateGuards = require('./raise-d5633a02.cjs.js');
|
|
4
4
|
|
|
5
5
|
function createSpawner(actorScope, {
|
|
6
6
|
machine,
|
|
@@ -118,69 +118,6 @@ function choose(branches) {
|
|
|
118
118
|
return choose;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
function resolveLog(_, state, actionArgs, actionParams, {
|
|
122
|
-
value,
|
|
123
|
-
label
|
|
124
|
-
}) {
|
|
125
|
-
return [state, {
|
|
126
|
-
value: typeof value === 'function' ? value(actionArgs, actionParams) : value,
|
|
127
|
-
label
|
|
128
|
-
}];
|
|
129
|
-
}
|
|
130
|
-
function executeLog({
|
|
131
|
-
logger
|
|
132
|
-
}, {
|
|
133
|
-
value,
|
|
134
|
-
label
|
|
135
|
-
}) {
|
|
136
|
-
if (label) {
|
|
137
|
-
logger(label, value);
|
|
138
|
-
} else {
|
|
139
|
-
logger(value);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
*
|
|
144
|
-
* @param expr The expression function to evaluate which will be logged.
|
|
145
|
-
* Takes in 2 arguments:
|
|
146
|
-
* - `ctx` - the current state context
|
|
147
|
-
* - `event` - the event that caused this action to be executed.
|
|
148
|
-
* @param label The label to give to the logged expression.
|
|
149
|
-
*/
|
|
150
|
-
function log(value = ({
|
|
151
|
-
context,
|
|
152
|
-
event
|
|
153
|
-
}) => ({
|
|
154
|
-
context,
|
|
155
|
-
event
|
|
156
|
-
}), label) {
|
|
157
|
-
function log(args, params) {
|
|
158
|
-
}
|
|
159
|
-
log.type = 'xstate.log';
|
|
160
|
-
log.value = value;
|
|
161
|
-
log.label = label;
|
|
162
|
-
log.resolve = resolveLog;
|
|
163
|
-
log.execute = executeLog;
|
|
164
|
-
return log;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function resolvePure(_, state, args, _actionParams, {
|
|
168
|
-
get
|
|
169
|
-
}) {
|
|
170
|
-
return [state, undefined, guards_dist_xstateGuards.toArray(get({
|
|
171
|
-
context: args.context,
|
|
172
|
-
event: args.event
|
|
173
|
-
}))];
|
|
174
|
-
}
|
|
175
|
-
function pure(getActions) {
|
|
176
|
-
function pure(args, params) {
|
|
177
|
-
}
|
|
178
|
-
pure.type = 'xstate.pure';
|
|
179
|
-
pure.get = getActions;
|
|
180
|
-
pure.resolve = resolvePure;
|
|
181
|
-
return pure;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
121
|
/**
|
|
185
122
|
*
|
|
186
123
|
* @remarks
|
|
@@ -371,9 +308,115 @@ function escalate(errorData, options) {
|
|
|
371
308
|
}, options);
|
|
372
309
|
}
|
|
373
310
|
|
|
311
|
+
function resolveEnqueueActions(_, state, args, _actionParams, {
|
|
312
|
+
collect
|
|
313
|
+
}) {
|
|
314
|
+
const actions = [];
|
|
315
|
+
const enqueue = function enqueue(action) {
|
|
316
|
+
actions.push(action);
|
|
317
|
+
};
|
|
318
|
+
enqueue.assign = (...args) => {
|
|
319
|
+
actions.push(assign(...args));
|
|
320
|
+
};
|
|
321
|
+
enqueue.cancel = (...args) => {
|
|
322
|
+
actions.push(guards_dist_xstateGuards.cancel(...args));
|
|
323
|
+
};
|
|
324
|
+
enqueue.raise = (...args) => {
|
|
325
|
+
actions.push(guards_dist_xstateGuards.raise(...args));
|
|
326
|
+
};
|
|
327
|
+
enqueue.sendTo = (...args) => {
|
|
328
|
+
actions.push(sendTo(...args));
|
|
329
|
+
};
|
|
330
|
+
enqueue.spawnChild = (...args) => {
|
|
331
|
+
actions.push(guards_dist_xstateGuards.spawnChild(...args));
|
|
332
|
+
};
|
|
333
|
+
enqueue.stopChild = (...args) => {
|
|
334
|
+
actions.push(guards_dist_xstateGuards.stopChild(...args));
|
|
335
|
+
};
|
|
336
|
+
collect({
|
|
337
|
+
context: args.context,
|
|
338
|
+
event: args.event,
|
|
339
|
+
enqueue,
|
|
340
|
+
check: guard => guards_dist_xstateGuards.evaluateGuard(guard, state.context, args.event, state)
|
|
341
|
+
});
|
|
342
|
+
return [state, undefined, actions];
|
|
343
|
+
}
|
|
344
|
+
function enqueueActions(collect) {
|
|
345
|
+
function enqueueActions(args, params) {
|
|
346
|
+
}
|
|
347
|
+
enqueueActions.type = 'xstate.enqueueActions';
|
|
348
|
+
enqueueActions.collect = collect;
|
|
349
|
+
enqueueActions.resolve = resolveEnqueueActions;
|
|
350
|
+
return enqueueActions;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function resolveLog(_, state, actionArgs, actionParams, {
|
|
354
|
+
value,
|
|
355
|
+
label
|
|
356
|
+
}) {
|
|
357
|
+
return [state, {
|
|
358
|
+
value: typeof value === 'function' ? value(actionArgs, actionParams) : value,
|
|
359
|
+
label
|
|
360
|
+
}];
|
|
361
|
+
}
|
|
362
|
+
function executeLog({
|
|
363
|
+
logger
|
|
364
|
+
}, {
|
|
365
|
+
value,
|
|
366
|
+
label
|
|
367
|
+
}) {
|
|
368
|
+
if (label) {
|
|
369
|
+
logger(label, value);
|
|
370
|
+
} else {
|
|
371
|
+
logger(value);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
*
|
|
376
|
+
* @param expr The expression function to evaluate which will be logged.
|
|
377
|
+
* Takes in 2 arguments:
|
|
378
|
+
* - `ctx` - the current state context
|
|
379
|
+
* - `event` - the event that caused this action to be executed.
|
|
380
|
+
* @param label The label to give to the logged expression.
|
|
381
|
+
*/
|
|
382
|
+
function log(value = ({
|
|
383
|
+
context,
|
|
384
|
+
event
|
|
385
|
+
}) => ({
|
|
386
|
+
context,
|
|
387
|
+
event
|
|
388
|
+
}), label) {
|
|
389
|
+
function log(args, params) {
|
|
390
|
+
}
|
|
391
|
+
log.type = 'xstate.log';
|
|
392
|
+
log.value = value;
|
|
393
|
+
log.label = label;
|
|
394
|
+
log.resolve = resolveLog;
|
|
395
|
+
log.execute = executeLog;
|
|
396
|
+
return log;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
*
|
|
401
|
+
* @deprecated Use `enqueueActions(...)` instead
|
|
402
|
+
*/
|
|
403
|
+
function pure(getActions) {
|
|
404
|
+
return enqueueActions(({
|
|
405
|
+
context,
|
|
406
|
+
event,
|
|
407
|
+
enqueue
|
|
408
|
+
}) => {
|
|
409
|
+
guards_dist_xstateGuards.toArray(getActions({
|
|
410
|
+
context,
|
|
411
|
+
event
|
|
412
|
+
})).forEach(enqueue);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
374
416
|
exports.SpecialTargets = SpecialTargets;
|
|
375
417
|
exports.assign = assign;
|
|
376
418
|
exports.choose = choose;
|
|
419
|
+
exports.enqueueActions = enqueueActions;
|
|
377
420
|
exports.escalate = escalate;
|
|
378
421
|
exports.forwardTo = forwardTo;
|
|
379
422
|
exports.log = log;
|
|
@@ -203,14 +203,10 @@ function matchesState(parentStateId, childStateId) {
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
function toStatePath(stateId) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return stateId;
|
|
209
|
-
}
|
|
210
|
-
return stateId.split(STATE_DELIMITER);
|
|
211
|
-
} catch (e) {
|
|
212
|
-
throw new Error(`'${stateId}' is not a valid state path.`);
|
|
206
|
+
if (isArray(stateId)) {
|
|
207
|
+
return stateId;
|
|
213
208
|
}
|
|
209
|
+
return stateId.split(STATE_DELIMITER);
|
|
214
210
|
}
|
|
215
211
|
function toStateValue(stateValue) {
|
|
216
212
|
if (isMachineSnapshot(stateValue)) {
|
|
@@ -1332,8 +1328,7 @@ function getDelayedTransitions(stateNode) {
|
|
|
1332
1328
|
return [];
|
|
1333
1329
|
}
|
|
1334
1330
|
const mutateEntryExit = (delay, i) => {
|
|
1335
|
-
const
|
|
1336
|
-
const afterEvent = createAfterEvent(delayRef, stateNode.id);
|
|
1331
|
+
const afterEvent = createAfterEvent(delay, stateNode.id);
|
|
1337
1332
|
const eventType = afterEvent.type;
|
|
1338
1333
|
stateNode.entry.push(raise(afterEvent, {
|
|
1339
1334
|
id: eventType,
|
|
@@ -1347,8 +1342,8 @@ function getDelayedTransitions(stateNode) {
|
|
|
1347
1342
|
const resolvedTransition = typeof configTransition === 'string' ? {
|
|
1348
1343
|
target: configTransition
|
|
1349
1344
|
} : configTransition;
|
|
1350
|
-
const resolvedDelay =
|
|
1351
|
-
const eventType = mutateEntryExit(resolvedDelay
|
|
1345
|
+
const resolvedDelay = Number.isNaN(+delay) ? delay : +delay;
|
|
1346
|
+
const eventType = mutateEntryExit(resolvedDelay);
|
|
1352
1347
|
return toArray(resolvedTransition).map(transition => ({
|
|
1353
1348
|
...transition,
|
|
1354
1349
|
event: eventType,
|
|
@@ -2319,4 +2314,4 @@ function raise(eventOrExpr, options) {
|
|
|
2319
2314
|
return raise;
|
|
2320
2315
|
}
|
|
2321
2316
|
|
|
2322
|
-
export { $$ACTOR_TYPE as $, Actor as A, interpret as B, isMachineSnapshot as C, matchesState as D, pathToStateValue as E, toObserver as F, getAllOwnEventDescriptors as G, and as H, not as I, or as J, stateIn as K, cancel as L, raise as M, NULL_EVENT as N,
|
|
2317
|
+
export { $$ACTOR_TYPE as $, Actor as A, interpret as B, isMachineSnapshot as C, matchesState as D, pathToStateValue as E, toObserver as F, getAllOwnEventDescriptors as G, and as H, not as I, or as J, stateIn as K, cancel as L, raise as M, NULL_EVENT as N, spawnChild as O, stop as P, stopChild as Q, ProcessingStatus as R, STATE_DELIMITER as S, cloneMachineSnapshot as T, XSTATE_ERROR as U, createErrorActorEvent as V, XSTATE_STOP as X, toTransitionConfigArray as a, formatTransition as b, createInvokeId as c, formatInitialTransition as d, evaluateGuard as e, formatTransitions as f, getDelayedTransitions as g, getCandidates as h, getAllStateNodes as i, getStateNodes as j, createMachineSnapshot as k, isInFinalState as l, mapValues as m, macrostep as n, transitionNode as o, resolveActionsAndContext as p, createInitEvent as q, resolveStateValue as r, microstep as s, toArray as t, getInitialStateNodes as u, isStateId as v, getStateNodeByPath as w, getPersistedState as x, resolveReferencedActor as y, createActor as z };
|
|
@@ -205,14 +205,10 @@ function matchesState(parentStateId, childStateId) {
|
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
function toStatePath(stateId) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
return stateId;
|
|
211
|
-
}
|
|
212
|
-
return stateId.split(STATE_DELIMITER);
|
|
213
|
-
} catch (e) {
|
|
214
|
-
throw new Error(`'${stateId}' is not a valid state path.`);
|
|
208
|
+
if (isArray(stateId)) {
|
|
209
|
+
return stateId;
|
|
215
210
|
}
|
|
211
|
+
return stateId.split(STATE_DELIMITER);
|
|
216
212
|
}
|
|
217
213
|
function toStateValue(stateValue) {
|
|
218
214
|
if (isMachineSnapshot(stateValue)) {
|
|
@@ -1371,8 +1367,7 @@ function getDelayedTransitions(stateNode) {
|
|
|
1371
1367
|
return [];
|
|
1372
1368
|
}
|
|
1373
1369
|
const mutateEntryExit = (delay, i) => {
|
|
1374
|
-
const
|
|
1375
|
-
const afterEvent = createAfterEvent(delayRef, stateNode.id);
|
|
1370
|
+
const afterEvent = createAfterEvent(delay, stateNode.id);
|
|
1376
1371
|
const eventType = afterEvent.type;
|
|
1377
1372
|
stateNode.entry.push(raise(afterEvent, {
|
|
1378
1373
|
id: eventType,
|
|
@@ -1386,8 +1381,8 @@ function getDelayedTransitions(stateNode) {
|
|
|
1386
1381
|
const resolvedTransition = typeof configTransition === 'string' ? {
|
|
1387
1382
|
target: configTransition
|
|
1388
1383
|
} : configTransition;
|
|
1389
|
-
const resolvedDelay =
|
|
1390
|
-
const eventType = mutateEntryExit(resolvedDelay
|
|
1384
|
+
const resolvedDelay = Number.isNaN(+delay) ? delay : +delay;
|
|
1385
|
+
const eventType = mutateEntryExit(resolvedDelay);
|
|
1391
1386
|
return toArray(resolvedTransition).map(transition => ({
|
|
1392
1387
|
...transition,
|
|
1393
1388
|
event: eventType,
|
|
@@ -203,14 +203,10 @@ function matchesState(parentStateId, childStateId) {
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
function toStatePath(stateId) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return stateId;
|
|
209
|
-
}
|
|
210
|
-
return stateId.split(STATE_DELIMITER);
|
|
211
|
-
} catch (e) {
|
|
212
|
-
throw new Error(`'${stateId}' is not a valid state path.`);
|
|
206
|
+
if (isArray(stateId)) {
|
|
207
|
+
return stateId;
|
|
213
208
|
}
|
|
209
|
+
return stateId.split(STATE_DELIMITER);
|
|
214
210
|
}
|
|
215
211
|
function toStateValue(stateValue) {
|
|
216
212
|
if (isMachineSnapshot(stateValue)) {
|
|
@@ -1369,8 +1365,7 @@ function getDelayedTransitions(stateNode) {
|
|
|
1369
1365
|
return [];
|
|
1370
1366
|
}
|
|
1371
1367
|
const mutateEntryExit = (delay, i) => {
|
|
1372
|
-
const
|
|
1373
|
-
const afterEvent = createAfterEvent(delayRef, stateNode.id);
|
|
1368
|
+
const afterEvent = createAfterEvent(delay, stateNode.id);
|
|
1374
1369
|
const eventType = afterEvent.type;
|
|
1375
1370
|
stateNode.entry.push(raise(afterEvent, {
|
|
1376
1371
|
id: eventType,
|
|
@@ -1384,8 +1379,8 @@ function getDelayedTransitions(stateNode) {
|
|
|
1384
1379
|
const resolvedTransition = typeof configTransition === 'string' ? {
|
|
1385
1380
|
target: configTransition
|
|
1386
1381
|
} : configTransition;
|
|
1387
|
-
const resolvedDelay =
|
|
1388
|
-
const eventType = mutateEntryExit(resolvedDelay
|
|
1382
|
+
const resolvedDelay = Number.isNaN(+delay) ? delay : +delay;
|
|
1383
|
+
const eventType = mutateEntryExit(resolvedDelay);
|
|
1389
1384
|
return toArray(resolvedTransition).map(transition => ({
|
|
1390
1385
|
...transition,
|
|
1391
1386
|
event: eventType,
|
|
@@ -2373,4 +2368,4 @@ function raise(eventOrExpr, options) {
|
|
|
2373
2368
|
return raise;
|
|
2374
2369
|
}
|
|
2375
2370
|
|
|
2376
|
-
export { $$ACTOR_TYPE as $, Actor as A, interpret as B, isMachineSnapshot as C, matchesState as D, pathToStateValue as E, toObserver as F, getAllOwnEventDescriptors as G, and as H, not as I, or as J, stateIn as K, cancel as L, raise as M, NULL_EVENT as N,
|
|
2371
|
+
export { $$ACTOR_TYPE as $, Actor as A, interpret as B, isMachineSnapshot as C, matchesState as D, pathToStateValue as E, toObserver as F, getAllOwnEventDescriptors as G, and as H, not as I, or as J, stateIn as K, cancel as L, raise as M, NULL_EVENT as N, spawnChild as O, stop as P, stopChild as Q, ProcessingStatus as R, STATE_DELIMITER as S, cloneMachineSnapshot as T, XSTATE_ERROR as U, createErrorActorEvent as V, XSTATE_STOP as X, toTransitionConfigArray as a, formatTransition as b, createInvokeId as c, formatInitialTransition as d, evaluateGuard as e, formatTransitions as f, getDelayedTransitions as g, getCandidates as h, getAllStateNodes as i, getStateNodes as j, createMachineSnapshot as k, isInFinalState as l, mapValues as m, macrostep as n, transitionNode as o, resolveActionsAndContext as p, createInitEvent as q, resolveStateValue as r, microstep as s, toArray as t, getInitialStateNodes as u, isStateId as v, getStateNodeByPath as w, getPersistedState as x, resolveReferencedActor as y, createActor as z };
|
|
@@ -205,14 +205,10 @@ function matchesState(parentStateId, childStateId) {
|
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
function toStatePath(stateId) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
return stateId;
|
|
211
|
-
}
|
|
212
|
-
return stateId.split(STATE_DELIMITER);
|
|
213
|
-
} catch (e) {
|
|
214
|
-
throw new Error(`'${stateId}' is not a valid state path.`);
|
|
208
|
+
if (isArray(stateId)) {
|
|
209
|
+
return stateId;
|
|
215
210
|
}
|
|
211
|
+
return stateId.split(STATE_DELIMITER);
|
|
216
212
|
}
|
|
217
213
|
function toStateValue(stateValue) {
|
|
218
214
|
if (isMachineSnapshot(stateValue)) {
|
|
@@ -1334,8 +1330,7 @@ function getDelayedTransitions(stateNode) {
|
|
|
1334
1330
|
return [];
|
|
1335
1331
|
}
|
|
1336
1332
|
const mutateEntryExit = (delay, i) => {
|
|
1337
|
-
const
|
|
1338
|
-
const afterEvent = createAfterEvent(delayRef, stateNode.id);
|
|
1333
|
+
const afterEvent = createAfterEvent(delay, stateNode.id);
|
|
1339
1334
|
const eventType = afterEvent.type;
|
|
1340
1335
|
stateNode.entry.push(raise(afterEvent, {
|
|
1341
1336
|
id: eventType,
|
|
@@ -1349,8 +1344,8 @@ function getDelayedTransitions(stateNode) {
|
|
|
1349
1344
|
const resolvedTransition = typeof configTransition === 'string' ? {
|
|
1350
1345
|
target: configTransition
|
|
1351
1346
|
} : configTransition;
|
|
1352
|
-
const resolvedDelay =
|
|
1353
|
-
const eventType = mutateEntryExit(resolvedDelay
|
|
1347
|
+
const resolvedDelay = Number.isNaN(+delay) ? delay : +delay;
|
|
1348
|
+
const eventType = mutateEntryExit(resolvedDelay);
|
|
1354
1349
|
return toArray(resolvedTransition).map(transition => ({
|
|
1355
1350
|
...transition,
|
|
1356
1351
|
event: eventType,
|
package/dist/xstate.cjs.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var actors_dist_xstateActors = require('../actors/dist/xstate-actors.cjs.js');
|
|
6
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
7
|
-
var
|
|
6
|
+
var guards_dist_xstateGuards = require('./raise-d5633a02.cjs.js');
|
|
7
|
+
var pure = require('./pure-c5f1b46c.cjs.js');
|
|
8
8
|
require('../dev/dist/xstate-dev.cjs.js');
|
|
9
9
|
|
|
10
10
|
class SimulatedClock {
|
|
@@ -497,7 +497,7 @@ class StateMachine {
|
|
|
497
497
|
spawn,
|
|
498
498
|
input: event.input
|
|
499
499
|
});
|
|
500
|
-
return guards_dist_xstateGuards.resolveActionsAndContext(preInitial, initEvent, actorScope, [
|
|
500
|
+
return guards_dist_xstateGuards.resolveActionsAndContext(preInitial, initEvent, actorScope, [pure.assign(assignment)], internalQueue);
|
|
501
501
|
}
|
|
502
502
|
return preInitial;
|
|
503
503
|
}
|
|
@@ -716,15 +716,16 @@ exports.stateIn = guards_dist_xstateGuards.stateIn;
|
|
|
716
716
|
exports.stop = guards_dist_xstateGuards.stop;
|
|
717
717
|
exports.stopChild = guards_dist_xstateGuards.stopChild;
|
|
718
718
|
exports.toObserver = guards_dist_xstateGuards.toObserver;
|
|
719
|
-
exports.SpecialTargets =
|
|
720
|
-
exports.assign =
|
|
721
|
-
exports.choose =
|
|
722
|
-
exports.
|
|
723
|
-
exports.
|
|
724
|
-
exports.
|
|
725
|
-
exports.
|
|
726
|
-
exports.
|
|
727
|
-
exports.
|
|
719
|
+
exports.SpecialTargets = pure.SpecialTargets;
|
|
720
|
+
exports.assign = pure.assign;
|
|
721
|
+
exports.choose = pure.choose;
|
|
722
|
+
exports.enqueueActions = pure.enqueueActions;
|
|
723
|
+
exports.escalate = pure.escalate;
|
|
724
|
+
exports.forwardTo = pure.forwardTo;
|
|
725
|
+
exports.log = pure.log;
|
|
726
|
+
exports.pure = pure.pure;
|
|
727
|
+
exports.sendParent = pure.sendParent;
|
|
728
|
+
exports.sendTo = pure.sendTo;
|
|
728
729
|
exports.SimulatedClock = SimulatedClock;
|
|
729
730
|
exports.StateMachine = StateMachine;
|
|
730
731
|
exports.StateNode = StateNode;
|
package/dist/xstate.cjs.mjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var actors_dist_xstateActors = require('../actors/dist/xstate-actors.development.cjs.js');
|
|
6
|
-
var guards_dist_xstateGuards = require('./raise-
|
|
7
|
-
var
|
|
6
|
+
var guards_dist_xstateGuards = require('./raise-528386de.development.cjs.js');
|
|
7
|
+
var pure = require('./pure-a0f16134.development.cjs.js');
|
|
8
8
|
require('../dev/dist/xstate-dev.development.cjs.js');
|
|
9
9
|
|
|
10
10
|
class SimulatedClock {
|
|
@@ -500,7 +500,7 @@ class StateMachine {
|
|
|
500
500
|
spawn,
|
|
501
501
|
input: event.input
|
|
502
502
|
});
|
|
503
|
-
return guards_dist_xstateGuards.resolveActionsAndContext(preInitial, initEvent, actorScope, [
|
|
503
|
+
return guards_dist_xstateGuards.resolveActionsAndContext(preInitial, initEvent, actorScope, [pure.assign(assignment)], internalQueue);
|
|
504
504
|
}
|
|
505
505
|
return preInitial;
|
|
506
506
|
}
|
|
@@ -722,15 +722,16 @@ exports.stateIn = guards_dist_xstateGuards.stateIn;
|
|
|
722
722
|
exports.stop = guards_dist_xstateGuards.stop;
|
|
723
723
|
exports.stopChild = guards_dist_xstateGuards.stopChild;
|
|
724
724
|
exports.toObserver = guards_dist_xstateGuards.toObserver;
|
|
725
|
-
exports.SpecialTargets =
|
|
726
|
-
exports.assign =
|
|
727
|
-
exports.choose =
|
|
728
|
-
exports.
|
|
729
|
-
exports.
|
|
730
|
-
exports.
|
|
731
|
-
exports.
|
|
732
|
-
exports.
|
|
733
|
-
exports.
|
|
725
|
+
exports.SpecialTargets = pure.SpecialTargets;
|
|
726
|
+
exports.assign = pure.assign;
|
|
727
|
+
exports.choose = pure.choose;
|
|
728
|
+
exports.enqueueActions = pure.enqueueActions;
|
|
729
|
+
exports.escalate = pure.escalate;
|
|
730
|
+
exports.forwardTo = pure.forwardTo;
|
|
731
|
+
exports.log = pure.log;
|
|
732
|
+
exports.pure = pure.pure;
|
|
733
|
+
exports.sendParent = pure.sendParent;
|
|
734
|
+
exports.sendTo = pure.sendTo;
|
|
734
735
|
exports.SimulatedClock = SimulatedClock;
|
|
735
736
|
exports.StateMachine = StateMachine;
|
|
736
737
|
exports.StateNode = StateNode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.development.esm.js';
|
|
2
|
-
import { S as STATE_DELIMITER, m as mapValues, t as toArray, f as formatTransitions, a as toTransitionConfigArray, b as formatTransition, N as NULL_EVENT, e as evaluateGuard, c as createInvokeId, g as getDelayedTransitions, d as formatInitialTransition, h as getCandidates, r as resolveStateValue, i as getAllStateNodes, j as getStateNodes, k as createMachineSnapshot, l as isInFinalState, n as macrostep, o as transitionNode, p as resolveActionsAndContext, q as createInitEvent, s as microstep, u as getInitialStateNodes, v as isStateId, w as getStateNodeByPath, x as getPersistedState, y as resolveReferencedActor, z as createActor, $ as $$ACTOR_TYPE } from './raise-
|
|
3
|
-
export { A as Actor, G as __unsafe_getAllOwnEventDescriptors, H as and, L as cancel, z as createActor, j as getStateNodes, B as interpret, C as isMachineSnapshot, D as matchesState, I as not, J as or, E as pathToStateValue, M as raise,
|
|
4
|
-
import { a as assign } from './
|
|
5
|
-
export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent,
|
|
2
|
+
import { S as STATE_DELIMITER, m as mapValues, t as toArray, f as formatTransitions, a as toTransitionConfigArray, b as formatTransition, N as NULL_EVENT, e as evaluateGuard, c as createInvokeId, g as getDelayedTransitions, d as formatInitialTransition, h as getCandidates, r as resolveStateValue, i as getAllStateNodes, j as getStateNodes, k as createMachineSnapshot, l as isInFinalState, n as macrostep, o as transitionNode, p as resolveActionsAndContext, q as createInitEvent, s as microstep, u as getInitialStateNodes, v as isStateId, w as getStateNodeByPath, x as getPersistedState, y as resolveReferencedActor, z as createActor, $ as $$ACTOR_TYPE } from './raise-acaa3884.development.esm.js';
|
|
3
|
+
export { A as Actor, G as __unsafe_getAllOwnEventDescriptors, H as and, L as cancel, z as createActor, j as getStateNodes, B as interpret, C as isMachineSnapshot, D as matchesState, I as not, J as or, E as pathToStateValue, M as raise, O as spawnChild, K as stateIn, P as stop, Q as stopChild, F as toObserver } from './raise-acaa3884.development.esm.js';
|
|
4
|
+
import { a as assign } from './pure-296f8ebd.development.esm.js';
|
|
5
|
+
export { S as SpecialTargets, a as assign, c as choose, e as enqueueActions, b as escalate, f as forwardTo, l as log, p as pure, s as sendParent, d as sendTo } from './pure-296f8ebd.development.esm.js';
|
|
6
6
|
import '../dev/dist/xstate-dev.development.esm.js';
|
|
7
7
|
|
|
8
8
|
class SimulatedClock {
|
package/dist/xstate.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.esm.js';
|
|
2
|
-
import { S as STATE_DELIMITER, m as mapValues, t as toArray, f as formatTransitions, a as toTransitionConfigArray, b as formatTransition, N as NULL_EVENT, e as evaluateGuard, c as createInvokeId, g as getDelayedTransitions, d as formatInitialTransition, h as getCandidates, r as resolveStateValue, i as getAllStateNodes, j as getStateNodes, k as createMachineSnapshot, l as isInFinalState, n as macrostep, o as transitionNode, p as resolveActionsAndContext, q as createInitEvent, s as microstep, u as getInitialStateNodes, v as isStateId, w as getStateNodeByPath, x as getPersistedState, y as resolveReferencedActor, z as createActor, $ as $$ACTOR_TYPE } from './raise-
|
|
3
|
-
export { A as Actor, G as __unsafe_getAllOwnEventDescriptors, H as and, L as cancel, z as createActor, j as getStateNodes, B as interpret, C as isMachineSnapshot, D as matchesState, I as not, J as or, E as pathToStateValue, M as raise,
|
|
4
|
-
import { a as assign } from './
|
|
5
|
-
export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent,
|
|
2
|
+
import { S as STATE_DELIMITER, m as mapValues, t as toArray, f as formatTransitions, a as toTransitionConfigArray, b as formatTransition, N as NULL_EVENT, e as evaluateGuard, c as createInvokeId, g as getDelayedTransitions, d as formatInitialTransition, h as getCandidates, r as resolveStateValue, i as getAllStateNodes, j as getStateNodes, k as createMachineSnapshot, l as isInFinalState, n as macrostep, o as transitionNode, p as resolveActionsAndContext, q as createInitEvent, s as microstep, u as getInitialStateNodes, v as isStateId, w as getStateNodeByPath, x as getPersistedState, y as resolveReferencedActor, z as createActor, $ as $$ACTOR_TYPE } from './raise-4742bf04.esm.js';
|
|
3
|
+
export { A as Actor, G as __unsafe_getAllOwnEventDescriptors, H as and, L as cancel, z as createActor, j as getStateNodes, B as interpret, C as isMachineSnapshot, D as matchesState, I as not, J as or, E as pathToStateValue, M as raise, O as spawnChild, K as stateIn, P as stop, Q as stopChild, F as toObserver } from './raise-4742bf04.esm.js';
|
|
4
|
+
import { a as assign } from './pure-aefddc19.esm.js';
|
|
5
|
+
export { S as SpecialTargets, a as assign, c as choose, e as enqueueActions, b as escalate, f as forwardTo, l as log, p as pure, s as sendParent, d as sendTo } from './pure-aefddc19.esm.js';
|
|
6
6
|
import '../dev/dist/xstate-dev.esm.js';
|
|
7
7
|
|
|
8
8
|
class SimulatedClock {
|