Skip to content

timdrysdale/xstate-vue-demo

Repository files navigation

Vue 3 + Vite

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Recommended IDE Setup

Vuex and/or Xstate?

Both seems to be a halfway house, with posters commenting they move onto XState only if they can refactor legacy code from vuex But don't use the event bus in the example because it is deprecated for vue3

Front end can be a simple view layer

Logic can rest in the state machines.

The reddit example looks appropriate.

where each subreddit is instead a policy.

Back button ....

Can the xstate be tied to a top level component, so that its context is available to all components loaded with the router?

At present it reloads every time we return to the Booking component.

As an interim step, if not clear how to put xstate at top level, we could use pinia to store the state from booking, and rehydrate when going back to that page, rather than redoing all the network stuff. Except .... we can't then send events to the services. So we have to keep them running. Spawn? KeepAlive?

Provide iwth composition Provide and inject

Example

Bootstrap

https://getbootstrap.com/docs/5.2/getting-started/vite/ npm i --save-dev sass npm i --save bootstrap @popperjs/core

About

Tying out some xstate examples with vue

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published