statelyai / xstate-viz

Visualizer for XState machines
https://stately.ai/viz
MIT License
434 stars 102 forks source link

Enables viz to send events in child machines #352

Open sfvb opened 2 years ago

sfvb commented 2 years ago

This commit enables to send events in child machines by clicking on the transitions. https://discord.com/channels/795785288994652170/958236297967829042/958707869501501500

changeset-bot[bot] commented 2 years ago

⚠️ No Changeset found

Latest commit: 63114a779f6aebd73f09153fbee6fd185c3ebe2c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 2 years ago

Someone is attempting to deploy a commit to the Stately Team on Vercel.

A member of the Team first needs to authorize it.

Andarist commented 2 years ago

Could you elaborate? What is the exact user story here? I'm not sure how to properly test this.

sfvb commented 2 years ago

@Andarist For sure. Use for example this machine: https://stately.ai/viz/1cd64657-0d61-4ce7-b198-295de5e3f119

Behaviour In the current version: If you spawn a child machine, select the child machine in the Actors tab and then click on a transition: nothing will happen. https://www.loom.com/share/1bde3e788f104c0a80fd3f812f820b07

Desired behaviour after this PR: If you spawn a child machine, select the child machine in the Actors tab and then click on a transition: the event is send to the child and the machine transitions to the new state.