-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid selecting always transitions when the preceeding transition doe…
…sn't change the state (#4371) * Do not select the same always transitions after executimg them * Move the filtering if statement to a more correct place * only ignore action-less eventless transitions * Add failing test * Switch to comparing previous and next states * test executation count as well * remove irrelevant bit from a test case * add changeset * Add assign test * tweak behavior --------- Co-authored-by: David Khourshid <[email protected]>
- Loading branch information
1 parent
14cb2ed
commit 8b3f664
Showing
3 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'xstate': major | ||
--- | ||
|
||
Changed behavior of `always` transitions. Previously they were always selected after selecting any transition (including the `always` transitions). Because of that it was relatively easy to create an infinite loop using them. | ||
|
||
Now they are no longer selected if the preceeding transition doesn't change the state of a machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters