Skip to content

Commit 4f584f0

Browse files
committed
Renamed Result.ASYNC to Result.PENDING to avoid confusion with existing ASYNC constant (that is used to request an asynchronous transition)
1 parent 35fa59c commit 4f584f0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

state-machine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
SUCCEEDED: 1, // the event transitioned successfully from one state to another
1313
NOTRANSITION: 2, // the event was successfull but no state transition was necessary
1414
CANCELLED: 3, // the event was cancelled by the caller in a beforeEvent callback
15-
ASYNC: 4 // the event is asynchronous and the caller is in control of when the transition occurs
15+
PENDING: 4 // the event is asynchronous and the caller is in control of when the transition occurs
1616
},
1717

1818
Error: {
@@ -134,7 +134,7 @@
134134
return StateMachine.Result.CANCELLED;
135135
}
136136
else if (StateMachine.ASYNC === leave) {
137-
return StateMachine.Result.ASYNC;
137+
return StateMachine.Result.PENDING;
138138
}
139139
else {
140140
if (this.transition) // need to check in case user manually called transition() but forgot to return StateMachine.ASYNC

test/test_basics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ test("event return values (github issue #12) ", function() {
454454
equals(fsm.fake(), StateMachine.Result.CANCELLED, "expected event to have been CANCELLED");
455455
equals(fsm.current, 'ready', "cancelled event should not cause a transition");
456456

457-
equals(fsm.start(), StateMachine.Result.ASYNC, "expected event to cause an ASYNC transition");
457+
equals(fsm.start(), StateMachine.Result.PENDING, "expected event to cause a PENDING asynchronous transition");
458458
equals(fsm.current, 'ready', "async transition hasn't happened yet");
459459

460460
equals(fsm.transition(), StateMachine.Result.SUCCEEDED, "expected async transition to have SUCCEEDED");

0 commit comments

Comments
 (0)