[xstate/vue] Using Vue 3 composables in xState machines #5211
Unanswered
fcieminski
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
My question might seem trivial, but it's been bothering me. How should I use Vue 3's built-in composables, like for example
Router
, oruseAttrs
etc.? From what I know, these composables can’t be used outside of the<script setup>
or other composables. However, when creating an XState machine, there should ideally be only one source of truth. So, if there's something I need to process after a certain action, I should be able to use those composables inside the XState machine, for example in actions.Is there any way to make this work? Or am I misunderstanding how XState machines should work, and I should separate concerns between XState and Vue? What’s the best approach for this?
Beta Was this translation helpful? Give feedback.
All reactions