xstate 5.0.0-alpha.6 → 5.0.0-beta.10
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.d.mts +2 -0
- package/actions/dist/xstate-actions.cjs.d.mts.map +1 -0
- package/actions/dist/xstate-actions.cjs.d.ts +1 -0
- package/actions/dist/xstate-actions.cjs.d.ts.map +1 -0
- package/actions/dist/xstate-actions.cjs.dev.js +2 -2
- package/actions/dist/xstate-actions.cjs.mjs +24 -0
- package/actions/dist/xstate-actions.cjs.prod.js +3 -3
- package/actions/dist/xstate-actions.esm.js +1 -1
- 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.d.mts +2 -0
- package/actors/dist/xstate-actors.cjs.d.mts.map +1 -0
- package/actors/dist/xstate-actors.cjs.d.ts +1 -0
- package/actors/dist/xstate-actors.cjs.d.ts.map +1 -0
- package/actors/dist/xstate-actors.cjs.dev.js +2 -1
- package/actors/dist/xstate-actors.cjs.mjs +15 -0
- package/actors/dist/xstate-actors.cjs.prod.js +3 -2
- package/actors/dist/xstate-actors.esm.js +1 -1
- package/actors/dist/xstate-actors.umd.min.js +1 -1
- package/actors/dist/xstate-actors.umd.min.js.map +1 -1
- package/dev/dist/xstate-dev.cjs.d.mts +2 -0
- package/dev/dist/xstate-dev.cjs.d.mts.map +1 -0
- package/dev/dist/xstate-dev.cjs.d.ts +1 -0
- package/dev/dist/xstate-dev.cjs.d.ts.map +1 -0
- package/dev/dist/xstate-dev.cjs.mjs +5 -0
- package/dev/dist/xstate-dev.cjs.prod.js +6 -43
- package/dev/dist/xstate-dev.umd.min.js.map +1 -1
- package/dist/{actions-bf7bb1c5.cjs.dev.js → actions-109712d3.cjs.dev.js} +386 -371
- package/dist/{actions-41b74cdc.esm.js → actions-67f1d04e.esm.js} +341 -358
- package/dist/{actions-c46e4911.cjs.prod.js → actions-d0262a43.cjs.prod.js} +409 -380
- package/dist/declarations/src/State.d.ts +2 -3
- package/dist/declarations/src/StateMachine.d.ts +6 -6
- package/dist/declarations/src/StateNode.d.ts +3 -9
- package/dist/declarations/src/actions/send.d.ts +0 -7
- package/dist/declarations/src/actions.d.ts +9 -8
- package/dist/declarations/src/actors/index.d.ts +2 -1
- package/dist/declarations/src/actors/observable.d.ts +1 -2
- package/dist/declarations/src/actors/promise.d.ts +1 -2
- package/dist/declarations/src/guards.d.ts +2 -2
- package/dist/declarations/src/index.d.ts +13 -29
- package/dist/declarations/src/interpreter.d.ts +5 -4
- package/dist/declarations/src/spawn.d.ts +2 -2
- package/dist/declarations/src/stateUtils.d.ts +9 -14
- package/dist/declarations/src/typegenTypes.d.ts +7 -1
- package/dist/declarations/src/types.d.ts +18 -92
- package/dist/declarations/src/utils.d.ts +3 -5
- package/dist/declarations/src/waitFor.d.ts +33 -0
- package/dist/index-0f3fdf0c.cjs.prod.js +52 -0
- package/dist/xstate.cjs.d.mts +2 -0
- package/dist/xstate.cjs.d.mts.map +1 -0
- package/dist/xstate.cjs.d.ts +1 -0
- package/dist/xstate.cjs.d.ts.map +1 -0
- package/dist/xstate.cjs.dev.js +117 -105
- package/dist/xstate.cjs.mjs +38 -0
- package/dist/xstate.cjs.prod.js +115 -106
- package/dist/xstate.esm.js +100 -93
- package/dist/xstate.umd.min.js +1 -1
- package/dist/xstate.umd.min.js.map +1 -1
- package/guards/dist/xstate-guards.cjs.d.mts +2 -0
- package/guards/dist/xstate-guards.cjs.d.mts.map +1 -0
- package/guards/dist/xstate-guards.cjs.d.ts +1 -0
- package/guards/dist/xstate-guards.cjs.d.ts.map +1 -0
- package/guards/dist/xstate-guards.cjs.dev.js +1 -1
- package/guards/dist/xstate-guards.cjs.mjs +8 -0
- package/guards/dist/xstate-guards.cjs.prod.js +2 -2
- package/guards/dist/xstate-guards.esm.js +1 -1
- package/guards/dist/xstate-guards.umd.min.js +1 -1
- package/guards/dist/xstate-guards.umd.min.js.map +1 -1
- package/package.json +7 -1
- package/dist/declarations/src/schema.d.ts +0 -2
package/dist/xstate.cjs.dev.js
CHANGED
|
@@ -2,30 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var actors_dist_xstateActors = require('./actions-
|
|
5
|
+
var actors_dist_xstateActors = require('./actions-109712d3.cjs.dev.js');
|
|
6
6
|
require('./index-ebaab3c9.cjs.dev.js');
|
|
7
7
|
|
|
8
|
-
function pure(getActions) {
|
|
9
|
-
return actors_dist_xstateActors.createDynamicAction({
|
|
10
|
-
type: actors_dist_xstateActors.pure,
|
|
11
|
-
params: {
|
|
12
|
-
get: getActions
|
|
13
|
-
}
|
|
14
|
-
}, function (_event, _ref) {
|
|
15
|
-
var _toArray;
|
|
16
|
-
var state = _ref.state;
|
|
17
|
-
return [state, {
|
|
18
|
-
type: actors_dist_xstateActors.pure,
|
|
19
|
-
params: {
|
|
20
|
-
actions: (_toArray = actors_dist_xstateActors.toArray(actors_dist_xstateActors.toActionObjects(getActions({
|
|
21
|
-
context: state.context,
|
|
22
|
-
event: _event.data
|
|
23
|
-
})))) !== null && _toArray !== void 0 ? _toArray : []
|
|
24
|
-
}
|
|
25
|
-
}];
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
8
|
var _excluded = ["onDone", "onError"];
|
|
30
9
|
var EMPTY_OBJECT = {};
|
|
31
10
|
var StateNode = /*#__PURE__*/function () {
|
|
@@ -87,7 +66,7 @@ var StateNode = /*#__PURE__*/function () {
|
|
|
87
66
|
*/
|
|
88
67
|
|
|
89
68
|
/**
|
|
90
|
-
* The order this state node appears. Corresponds to the implicit
|
|
69
|
+
* The order this state node appears. Corresponds to the implicit document order.
|
|
91
70
|
*/
|
|
92
71
|
|
|
93
72
|
function StateNode(
|
|
@@ -176,7 +155,7 @@ var StateNode = /*#__PURE__*/function () {
|
|
|
176
155
|
source: this,
|
|
177
156
|
actions: this.initial.actions,
|
|
178
157
|
eventType: null,
|
|
179
|
-
|
|
158
|
+
reenter: false,
|
|
180
159
|
toJSON: function toJSON() {
|
|
181
160
|
return {
|
|
182
161
|
target: _this3.initial.target.map(function (t) {
|
|
@@ -235,9 +214,9 @@ var StateNode = /*#__PURE__*/function () {
|
|
|
235
214
|
id: resolvedId,
|
|
236
215
|
systemId: systemId,
|
|
237
216
|
toJSON: function toJSON() {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
invokeDefValues = actors_dist_xstateActors._objectWithoutProperties(invokeConfig, _excluded);
|
|
217
|
+
invokeConfig.onDone;
|
|
218
|
+
invokeConfig.onError;
|
|
219
|
+
var invokeDefValues = actors_dist_xstateActors._objectWithoutProperties(invokeConfig, _excluded);
|
|
241
220
|
return actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, invokeDefValues), {}, {
|
|
242
221
|
type: actors_dist_xstateActors.invoke,
|
|
243
222
|
src: resolvedSrc,
|
|
@@ -281,27 +260,15 @@ var StateNode = /*#__PURE__*/function () {
|
|
|
281
260
|
return actors_dist_xstateActors.formatInitialTransition(_this7, _this7.config.initial || []);
|
|
282
261
|
});
|
|
283
262
|
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Returns `true` if this state node explicitly handles the given event.
|
|
287
|
-
*
|
|
288
|
-
* @param event The event in question
|
|
289
|
-
*/
|
|
290
|
-
}, {
|
|
291
|
-
key: "handles",
|
|
292
|
-
value: function handles(event) {
|
|
293
|
-
return this.events.includes(event.type);
|
|
294
|
-
}
|
|
295
263
|
}, {
|
|
296
264
|
key: "next",
|
|
297
|
-
value: function next(state,
|
|
265
|
+
value: function next(state, event) {
|
|
298
266
|
var _this8 = this;
|
|
299
|
-
var
|
|
267
|
+
var eventType = event.type;
|
|
300
268
|
var actions = [];
|
|
301
269
|
var selectedTransition;
|
|
302
|
-
var candidates = actors_dist_xstateActors.memo(this, "candidates-".concat(
|
|
303
|
-
return actors_dist_xstateActors.getCandidates(_this8,
|
|
304
|
-
);
|
|
270
|
+
var candidates = actors_dist_xstateActors.memo(this, "candidates-".concat(eventType), function () {
|
|
271
|
+
return actors_dist_xstateActors.getCandidates(_this8, eventType);
|
|
305
272
|
});
|
|
306
273
|
var _iterator = actors_dist_xstateActors._createForOfIteratorHelper(candidates),
|
|
307
274
|
_step;
|
|
@@ -312,9 +279,9 @@ var StateNode = /*#__PURE__*/function () {
|
|
|
312
279
|
var resolvedContext = state.context;
|
|
313
280
|
var guardPassed = false;
|
|
314
281
|
try {
|
|
315
|
-
guardPassed = !guard || actors_dist_xstateActors.evaluateGuard(guard, resolvedContext,
|
|
282
|
+
guardPassed = !guard || actors_dist_xstateActors.evaluateGuard(guard, resolvedContext, event, state);
|
|
316
283
|
} catch (err) {
|
|
317
|
-
throw new Error("Unable to evaluate guard '".concat(guard.type, "' in transition for event '").concat(
|
|
284
|
+
throw new Error("Unable to evaluate guard '".concat(guard.type, "' in transition for event '").concat(eventType, "' in state node '").concat(this.id, "':\n").concat(err.message));
|
|
318
285
|
}
|
|
319
286
|
if (guardPassed) {
|
|
320
287
|
actions.push.apply(actions, actors_dist_xstateActors._toConsumableArray(candidate.actions));
|
|
@@ -400,7 +367,7 @@ var StateNode = /*#__PURE__*/function () {
|
|
|
400
367
|
key: "ownEvents",
|
|
401
368
|
get: function get() {
|
|
402
369
|
var events = new Set(this.transitions.filter(function (transition) {
|
|
403
|
-
return !(!transition.target && !transition.actions.length && !transition.
|
|
370
|
+
return !(!transition.target && !transition.actions.length && !transition.reenter);
|
|
404
371
|
}).map(function (transition) {
|
|
405
372
|
return transition.eventType;
|
|
406
373
|
}));
|
|
@@ -426,13 +393,13 @@ var StateMachine = /*#__PURE__*/function () {
|
|
|
426
393
|
* The raw config used to create the machine.
|
|
427
394
|
*/
|
|
428
395
|
config, options) {
|
|
429
|
-
var _this$config$
|
|
396
|
+
var _this$config$types;
|
|
430
397
|
actors_dist_xstateActors._classCallCheck(this, StateMachine);
|
|
431
398
|
this.config = config;
|
|
432
399
|
actors_dist_xstateActors._defineProperty(this, "version", void 0);
|
|
433
400
|
actors_dist_xstateActors._defineProperty(this, "delimiter", void 0);
|
|
434
401
|
actors_dist_xstateActors._defineProperty(this, "options", void 0);
|
|
435
|
-
actors_dist_xstateActors._defineProperty(this, "
|
|
402
|
+
actors_dist_xstateActors._defineProperty(this, "types", void 0);
|
|
436
403
|
actors_dist_xstateActors._defineProperty(this, "__xstatenode", true);
|
|
437
404
|
actors_dist_xstateActors._defineProperty(this, "idMap", new Map());
|
|
438
405
|
actors_dist_xstateActors._defineProperty(this, "root", void 0);
|
|
@@ -448,7 +415,7 @@ var StateMachine = /*#__PURE__*/function () {
|
|
|
448
415
|
this.options = Object.assign(createDefaultOptions(), options);
|
|
449
416
|
this.delimiter = this.config.delimiter || actors_dist_xstateActors.STATE_DELIMITER;
|
|
450
417
|
this.version = this.config.version;
|
|
451
|
-
this.
|
|
418
|
+
this.types = (_this$config$types = this.config.types) !== null && _this$config$types !== void 0 ? _this$config$types : {};
|
|
452
419
|
this.transition = this.transition.bind(this);
|
|
453
420
|
this.root = new StateNode(config, {
|
|
454
421
|
_key: this.id,
|
|
@@ -548,13 +515,12 @@ var StateMachine = /*#__PURE__*/function () {
|
|
|
548
515
|
var actorCtx = arguments.length > 2 ? arguments[2] : undefined;
|
|
549
516
|
var currentState = state instanceof actors_dist_xstateActors.State ? state : this.resolveStateValue(state);
|
|
550
517
|
// TODO: handle error events in a better way
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
return nextEvent === scxmlEvent.name;
|
|
518
|
+
if (actors_dist_xstateActors.isErrorEvent(event) && !currentState.nextEvents.some(function (nextEvent) {
|
|
519
|
+
return nextEvent === event.type;
|
|
554
520
|
})) {
|
|
555
|
-
throw
|
|
521
|
+
throw event.data;
|
|
556
522
|
}
|
|
557
|
-
var _macrostep = actors_dist_xstateActors.macrostep(currentState,
|
|
523
|
+
var _macrostep = actors_dist_xstateActors.macrostep(currentState, event, actorCtx),
|
|
558
524
|
nextState = _macrostep.state;
|
|
559
525
|
return nextState;
|
|
560
526
|
}
|
|
@@ -572,15 +538,12 @@ var StateMachine = /*#__PURE__*/function () {
|
|
|
572
538
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.initialState;
|
|
573
539
|
var event = arguments.length > 1 ? arguments[1] : undefined;
|
|
574
540
|
var actorCtx = arguments.length > 2 ? arguments[2] : undefined;
|
|
575
|
-
|
|
576
|
-
var _macrostep2 = actors_dist_xstateActors.macrostep(state, scxmlEvent, actorCtx),
|
|
577
|
-
microstates = _macrostep2.microstates;
|
|
578
|
-
return microstates;
|
|
541
|
+
return actors_dist_xstateActors.macrostep(state, event, actorCtx).microstates;
|
|
579
542
|
}
|
|
580
543
|
}, {
|
|
581
544
|
key: "getTransitionData",
|
|
582
|
-
value: function getTransitionData(state,
|
|
583
|
-
return actors_dist_xstateActors.transitionNode(this.root, state.value, state,
|
|
545
|
+
value: function getTransitionData(state, event) {
|
|
546
|
+
return actors_dist_xstateActors.transitionNode(this.root, state.value, state, event) || [];
|
|
584
547
|
}
|
|
585
548
|
|
|
586
549
|
/**
|
|
@@ -600,7 +563,7 @@ var StateMachine = /*#__PURE__*/function () {
|
|
|
600
563
|
value: {},
|
|
601
564
|
// TODO: this is computed in state constructor
|
|
602
565
|
context: context,
|
|
603
|
-
|
|
566
|
+
event: actors_dist_xstateActors.createInitEvent({}),
|
|
604
567
|
actions: [],
|
|
605
568
|
meta: undefined,
|
|
606
569
|
configuration: config,
|
|
@@ -640,8 +603,8 @@ var StateMachine = /*#__PURE__*/function () {
|
|
|
640
603
|
var preInitialState = this.getPreInitialState(actorCtx, input);
|
|
641
604
|
var nextState = actors_dist_xstateActors.microstep([], preInitialState, actorCtx, initEvent);
|
|
642
605
|
(_nextState$actions = nextState.actions).unshift.apply(_nextState$actions, actors_dist_xstateActors._toConsumableArray(preInitialState.actions));
|
|
643
|
-
var
|
|
644
|
-
macroState =
|
|
606
|
+
var _macrostep2 = actors_dist_xstateActors.macrostep(nextState, initEvent, actorCtx),
|
|
607
|
+
macroState = _macrostep2.state;
|
|
645
608
|
return macroState;
|
|
646
609
|
}
|
|
647
610
|
}, {
|
|
@@ -696,7 +659,7 @@ var StateMachine = /*#__PURE__*/function () {
|
|
|
696
659
|
key: "createState",
|
|
697
660
|
value: function createState(stateConfig) {
|
|
698
661
|
var state = stateConfig instanceof actors_dist_xstateActors.State ? stateConfig : new actors_dist_xstateActors.State(stateConfig, this);
|
|
699
|
-
var _resolveActionsAndCon2 = actors_dist_xstateActors.resolveActionsAndContext(state.actions, state.
|
|
662
|
+
var _resolveActionsAndCon2 = actors_dist_xstateActors.resolveActionsAndContext(state.actions, state.event, state, undefined),
|
|
700
663
|
resolvedState = _resolveActionsAndCon2.nextState;
|
|
701
664
|
return resolvedState;
|
|
702
665
|
}
|
|
@@ -780,11 +743,6 @@ function mapState(stateMap, stateId) {
|
|
|
780
743
|
return stateMap[foundStateId];
|
|
781
744
|
}
|
|
782
745
|
|
|
783
|
-
function createSchema(schema) {
|
|
784
|
-
return schema;
|
|
785
|
-
}
|
|
786
|
-
var t = createSchema;
|
|
787
|
-
|
|
788
746
|
var SimulatedClock = /*#__PURE__*/function () {
|
|
789
747
|
function SimulatedClock() {
|
|
790
748
|
actors_dist_xstateActors._classCallCheck(this, SimulatedClock);
|
|
@@ -832,12 +790,12 @@ var SimulatedClock = /*#__PURE__*/function () {
|
|
|
832
790
|
value: function flushTimeouts() {
|
|
833
791
|
var _this = this;
|
|
834
792
|
actors_dist_xstateActors._toConsumableArray(this.timeouts).sort(function (_ref, _ref2) {
|
|
835
|
-
var _ref3 = actors_dist_xstateActors._slicedToArray(_ref, 2)
|
|
836
|
-
|
|
837
|
-
timeoutA = _ref3[1];
|
|
838
|
-
var _ref4 = actors_dist_xstateActors._slicedToArray(_ref2, 2)
|
|
839
|
-
|
|
840
|
-
timeoutB = _ref4[1];
|
|
793
|
+
var _ref3 = actors_dist_xstateActors._slicedToArray(_ref, 2);
|
|
794
|
+
_ref3[0];
|
|
795
|
+
var timeoutA = _ref3[1];
|
|
796
|
+
var _ref4 = actors_dist_xstateActors._slicedToArray(_ref2, 2);
|
|
797
|
+
_ref4[0];
|
|
798
|
+
var timeoutB = _ref4[1];
|
|
841
799
|
var endA = timeoutA.start + timeoutA.timeout;
|
|
842
800
|
var endB = timeoutB.start + timeoutB.timeout;
|
|
843
801
|
return endB > endA ? -1 : 1;
|
|
@@ -861,61 +819,115 @@ var SimulatedClock = /*#__PURE__*/function () {
|
|
|
861
819
|
return SimulatedClock;
|
|
862
820
|
}();
|
|
863
821
|
|
|
864
|
-
var
|
|
865
|
-
|
|
866
|
-
send: actors_dist_xstateActors.send,
|
|
867
|
-
sendParent: actors_dist_xstateActors.sendParent,
|
|
868
|
-
sendTo: actors_dist_xstateActors.sendTo,
|
|
869
|
-
log: actors_dist_xstateActors.log,
|
|
870
|
-
cancel: actors_dist_xstateActors.cancel,
|
|
871
|
-
stop: actors_dist_xstateActors.stop,
|
|
872
|
-
assign: actors_dist_xstateActors.assign,
|
|
873
|
-
after: actors_dist_xstateActors.after,
|
|
874
|
-
done: actors_dist_xstateActors.done,
|
|
875
|
-
respond: actors_dist_xstateActors.respond,
|
|
876
|
-
forwardTo: actors_dist_xstateActors.forwardTo,
|
|
877
|
-
escalate: actors_dist_xstateActors.escalate,
|
|
878
|
-
choose: actors_dist_xstateActors.choose,
|
|
879
|
-
pure: pure
|
|
822
|
+
var defaultWaitForOptions = {
|
|
823
|
+
timeout: 10000 // 10 seconds
|
|
880
824
|
};
|
|
881
825
|
|
|
826
|
+
/**
|
|
827
|
+
* Subscribes to an actor ref and waits for its emitted value to satisfy
|
|
828
|
+
* a predicate, and then resolves with that value.
|
|
829
|
+
* Will throw if the desired state is not reached after a timeout
|
|
830
|
+
* (defaults to 10 seconds).
|
|
831
|
+
*
|
|
832
|
+
* @example
|
|
833
|
+
* ```js
|
|
834
|
+
* const state = await waitFor(someService, state => {
|
|
835
|
+
* return state.hasTag('loaded');
|
|
836
|
+
* });
|
|
837
|
+
*
|
|
838
|
+
* state.hasTag('loaded'); // true
|
|
839
|
+
* ```
|
|
840
|
+
*
|
|
841
|
+
* @param actorRef The actor ref to subscribe to
|
|
842
|
+
* @param predicate Determines if a value matches the condition to wait for
|
|
843
|
+
* @param options
|
|
844
|
+
* @returns A promise that eventually resolves to the emitted value
|
|
845
|
+
* that matches the condition
|
|
846
|
+
*/
|
|
847
|
+
function waitFor(actorRef, predicate, options) {
|
|
848
|
+
var resolvedOptions = actors_dist_xstateActors._objectSpread2(actors_dist_xstateActors._objectSpread2({}, defaultWaitForOptions), options);
|
|
849
|
+
return new Promise(function (res, rej) {
|
|
850
|
+
var done = false;
|
|
851
|
+
if (process.env.NODE_ENV !== 'production' && resolvedOptions.timeout < 0) {
|
|
852
|
+
console.error('`timeout` passed to `waitFor` is negative and it will reject its internal promise immediately.');
|
|
853
|
+
}
|
|
854
|
+
var handle = resolvedOptions.timeout === Infinity ? undefined : setTimeout(function () {
|
|
855
|
+
sub.unsubscribe();
|
|
856
|
+
rej(new Error("Timeout of ".concat(resolvedOptions.timeout, " ms exceeded")));
|
|
857
|
+
}, resolvedOptions.timeout);
|
|
858
|
+
var dispose = function dispose() {
|
|
859
|
+
clearTimeout(handle);
|
|
860
|
+
done = true;
|
|
861
|
+
sub === null || sub === void 0 ? void 0 : sub.unsubscribe();
|
|
862
|
+
};
|
|
863
|
+
function checkEmitted(emitted) {
|
|
864
|
+
if (predicate(emitted)) {
|
|
865
|
+
dispose();
|
|
866
|
+
res(emitted);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
// See if the current snapshot already matches the predicate
|
|
871
|
+
checkEmitted(actorRef.getSnapshot());
|
|
872
|
+
var sub = actorRef.subscribe({
|
|
873
|
+
next: checkEmitted,
|
|
874
|
+
error: function error(err) {
|
|
875
|
+
dispose();
|
|
876
|
+
rej(err);
|
|
877
|
+
},
|
|
878
|
+
complete: function complete() {
|
|
879
|
+
dispose();
|
|
880
|
+
rej(new Error("Actor terminated without satisfying predicate"));
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
if (done) {
|
|
884
|
+
sub.unsubscribe();
|
|
885
|
+
}
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
|
|
882
889
|
Object.defineProperty(exports, 'ActionTypes', {
|
|
883
890
|
enumerable: true,
|
|
884
|
-
get: function () {
|
|
885
|
-
return actors_dist_xstateActors.ActionTypes;
|
|
886
|
-
}
|
|
891
|
+
get: function () { return actors_dist_xstateActors.ActionTypes; }
|
|
887
892
|
});
|
|
888
893
|
exports.Interpreter = actors_dist_xstateActors.Interpreter;
|
|
889
894
|
Object.defineProperty(exports, 'InterpreterStatus', {
|
|
890
895
|
enumerable: true,
|
|
891
|
-
get: function () {
|
|
892
|
-
return actors_dist_xstateActors.ActorStatus;
|
|
893
|
-
}
|
|
896
|
+
get: function () { return actors_dist_xstateActors.ActorStatus; }
|
|
894
897
|
});
|
|
895
898
|
Object.defineProperty(exports, 'SpecialTargets', {
|
|
896
899
|
enumerable: true,
|
|
897
|
-
get: function () {
|
|
898
|
-
return actors_dist_xstateActors.SpecialTargets;
|
|
899
|
-
}
|
|
900
|
+
get: function () { return actors_dist_xstateActors.SpecialTargets; }
|
|
900
901
|
});
|
|
901
902
|
exports.State = actors_dist_xstateActors.State;
|
|
903
|
+
exports.and = actors_dist_xstateActors.and;
|
|
902
904
|
exports.assign = actors_dist_xstateActors.assign;
|
|
905
|
+
exports.cancel = actors_dist_xstateActors.cancel;
|
|
906
|
+
exports.choose = actors_dist_xstateActors.choose;
|
|
903
907
|
exports.doneInvoke = actors_dist_xstateActors.doneInvoke;
|
|
904
908
|
exports.forwardTo = actors_dist_xstateActors.forwardTo;
|
|
909
|
+
exports.fromCallback = actors_dist_xstateActors.fromCallback;
|
|
910
|
+
exports.fromEventObservable = actors_dist_xstateActors.fromEventObservable;
|
|
911
|
+
exports.fromObservable = actors_dist_xstateActors.fromObservable;
|
|
912
|
+
exports.fromPromise = actors_dist_xstateActors.fromPromise;
|
|
913
|
+
exports.fromTransition = actors_dist_xstateActors.fromTransition;
|
|
905
914
|
exports.getStateNodes = actors_dist_xstateActors.getStateNodes;
|
|
906
915
|
exports.interpret = actors_dist_xstateActors.interpret;
|
|
916
|
+
exports.log = actors_dist_xstateActors.log;
|
|
907
917
|
exports.matchesState = actors_dist_xstateActors.matchesState;
|
|
918
|
+
exports.not = actors_dist_xstateActors.not;
|
|
919
|
+
exports.or = actors_dist_xstateActors.or;
|
|
908
920
|
exports.pathToStateValue = actors_dist_xstateActors.pathToStateValue;
|
|
909
|
-
exports.
|
|
921
|
+
exports.pure = actors_dist_xstateActors.pure;
|
|
922
|
+
exports.raise = actors_dist_xstateActors.raise;
|
|
910
923
|
exports.sendParent = actors_dist_xstateActors.sendParent;
|
|
911
924
|
exports.sendTo = actors_dist_xstateActors.sendTo;
|
|
925
|
+
exports.stateIn = actors_dist_xstateActors.stateIn;
|
|
926
|
+
exports.stop = actors_dist_xstateActors.stop;
|
|
912
927
|
exports.toObserver = actors_dist_xstateActors.toObserver;
|
|
913
|
-
exports.toSCXMLEvent = actors_dist_xstateActors.toSCXMLEvent;
|
|
914
928
|
exports.SimulatedClock = SimulatedClock;
|
|
915
929
|
exports.StateMachine = StateMachine;
|
|
916
930
|
exports.StateNode = StateNode;
|
|
917
|
-
exports.actions = actions;
|
|
918
931
|
exports.createMachine = createMachine;
|
|
919
|
-
exports.createSchema = createSchema;
|
|
920
932
|
exports.mapState = mapState;
|
|
921
|
-
exports.
|
|
933
|
+
exports.waitFor = waitFor;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ActionTypes,
|
|
3
|
+
Interpreter,
|
|
4
|
+
InterpreterStatus,
|
|
5
|
+
SimulatedClock,
|
|
6
|
+
SpecialTargets,
|
|
7
|
+
State,
|
|
8
|
+
StateMachine,
|
|
9
|
+
StateNode,
|
|
10
|
+
and,
|
|
11
|
+
assign,
|
|
12
|
+
cancel,
|
|
13
|
+
choose,
|
|
14
|
+
createMachine,
|
|
15
|
+
doneInvoke,
|
|
16
|
+
forwardTo,
|
|
17
|
+
fromCallback,
|
|
18
|
+
fromEventObservable,
|
|
19
|
+
fromObservable,
|
|
20
|
+
fromPromise,
|
|
21
|
+
fromTransition,
|
|
22
|
+
getStateNodes,
|
|
23
|
+
interpret,
|
|
24
|
+
log,
|
|
25
|
+
mapState,
|
|
26
|
+
matchesState,
|
|
27
|
+
not,
|
|
28
|
+
or,
|
|
29
|
+
pathToStateValue,
|
|
30
|
+
pure,
|
|
31
|
+
raise,
|
|
32
|
+
sendParent,
|
|
33
|
+
sendTo,
|
|
34
|
+
stateIn,
|
|
35
|
+
stop,
|
|
36
|
+
toObserver,
|
|
37
|
+
waitFor
|
|
38
|
+
} from "./xstate.cjs.js";
|