Usage with Vue | XState Docs
Vue follows a similar pattern to React: The machine can be defined externally; The service is placed on the data object; State changes are observed via service.onTransition(state => ...), where you set some data property to the next state; The machine's context can be referenced as an external data store by the app.
https://xstate.js.org/docs/recipes/vue.html