xstate
xstate copied to clipboard
[v5] Simplify `interpreter.send(...)` method
This PR:
- Removes the 2nd
payload?argument frominterpreter.send(...) - Only allows event objects (normal & SCXML) in
interpreter.send(...) - Refactors tests
-actor.send('SOME_EVENT')
+actor.send({ type: 'SOME_EVENT' })
-actor.send('EVENT', { some: 'payload' })
+actor.send({ type: 'EVENT', some: 'payload' })
🦋 Changeset detected
Latest commit: 03cb7ae0e37a5aaeee75267de82e03589b291ead
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 4 packages
| Name | Type |
|---|---|
| xstate | Major |
| @xstate/fsm | Major |
| @xstate/react | Major |
| @xstate/vue | Major |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 03cb7ae0e37a5aaeee75267de82e03589b291ead:
| Sandbox | Source |
|---|---|
| XState Example Template | Configuration |
| XState React Template | Configuration |
👇 Click on the image for a new way to code review
-
Make big changes easier — review code in small groups of related files
-
Know where to start — see the whole change at a glance
-
Take a code tour — explore the change with an interactive tour
-
Make comments and review — all fully sync’ed with github
Legend

@davidkpiano we only need to add more changesets here, but please don't merge this into v5/interpret-all-behaviors just yet - let's land that PR first and only then land this onto next