-
-
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.
Add support for wildcard transitions to
@xstate/fsm
(#4065)
* Add support for wildcard transitions to xstate-fsm. * Update docs for xstate-fsm to match its README. * Add changeset for wildcard event types. * Fix typing of wildcard transitions. * Fix broken type test. Because the test checks the `TEvent` parameter to `Transition`, which is only used in function signatures, the TypeScript configuration must have `strictFunctionTypes` enabled for the test to function. * Refactor types/tests, revert strictFunctionTypes. - Simplified the types used in the wildcard bevavior tests to make it easier to follow them. - Refactored `StateMachine.Config` to make it more readable. - Reverted enabling "strictFunctionTypes" and added a note to the relevant test saying that it will need updated when that option is reenabled. (Enabling "strictFunctionTypes" globally will be part of a separate effort.) * Update .changeset/tall-flies-occur.md --------- Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
- Loading branch information
Showing
7 changed files
with
135 additions
and
16 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/fsm': minor | ||
--- | ||
|
||
This change adds support for using "\*" as a wildcard event type in machine configs. | ||
|
||
Because that event type previously held no special meaning, it was allowed as an event type both in configs and when transitioning and matched as any other would. As a result of changing it to be a wildcard, any code which uses "\*" as an ordinary event type will break, making this a major change. |
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
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
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