-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor how builtin actions are structured and how all actions are s…
…tored and resolved (#4127) * Refactor builtin actions in order to remove the fake callable signature * Declassify the builtin actions * Fix and cleanup types * add extra type tests to raise * Provide `action` to action implementations again * Bring back .type for builtins * Convert string action to an object form when creating action args * Temporarily serialize~ actions in machine definition to pass JSON schema test * Fixed `.after` cancellation * Hoist `toSerializableActon` * add changeset * Remove outdated comment
- Loading branch information
Showing
39 changed files
with
1,197 additions
and
1,603 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,17 @@ | ||
--- | ||
'xstate': major | ||
--- | ||
|
||
IDs for delayed events are no longer derived from event types so this won't work automatically: | ||
|
||
```ts | ||
entry: raise({ type: 'TIMER' }, { delay: 200 }); | ||
exit: cancel('TIMER'); | ||
``` | ||
|
||
Please use explicit IDs: | ||
|
||
```ts | ||
entry: raise({ type: 'TIMER' }, { delay: 200, id: 'myTimer' }); | ||
exit: cancel('myTimer'); | ||
``` |
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,5 @@ | ||
--- | ||
'xstate': major | ||
--- | ||
|
||
All builtin action creators (`assign`, `sendTo`, etc) are now returning _functions_. They exact shape of those is considered an implementation detail of XState and users are meant to only pass around the returned values. |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.