xstate icon indicating copy to clipboard operation
xstate copied to clipboard

[v5] Simplify `interpreter.send(...)` method

Open davidkpiano opened this issue 3 years ago • 4 comments

This PR:

  • Removes the 2nd payload? argument from interpreter.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' })

Discord poll/discussion

davidkpiano avatar Sep 04 '22 02:09 davidkpiano

🦋 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

changeset-bot[bot] avatar Sep 04 '22 02:09 changeset-bot[bot]

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

codesandbox-ci[bot] avatar Sep 04 '22 02:09 codesandbox-ci[bot]

👇 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

    Try it now!

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

ghost avatar Sep 04 '22 02:09 ghost

@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

Andarist avatar Sep 05 '22 11:09 Andarist