Pass A Value In To An on In An XState Send Event

This is how I'm sending data into an XState state machine from an external source. I use it, for example, when I'm getting new data coming in from a web socket

Notes
  • The biggest thing that caught me was that the actions have to be inside their own object after the one with the states and contexts, etc... in it

  • I'm not sure if this is the ideal way to do this, but it's the only way I could figure out how to do it. I wouldn't be surprised to find out I'm missing something

Reference

Reference

Reference

Reference

Reference

Reference