Replies: 2 comments 2 replies
-
You should not have to provide any generic types. This should look like: export const myMachine = createMachine({
types: {} as {
context: MyContext;
events: MyEvents;
// state types not supported right now
},
// ...
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
@davidkpiano thanks (on multiple fronts - xstate-pinia! too) Ok I figured as much...(video was prob not the nest starting point even for v4 - it was a vue3 example as they seem fairly thin on the ground)! How far out aprox. is Thanks again! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there the need for additional "breaking change" documentation for v4?
With v4 one could provide typescript types for the Context, Events and States. However I now get a Typescript error, that the declaration now requires 10 not 3 generic parameters?
I initially followed this youtube vue3 tutorial - where they declared these type outside.
I was looking to see if I can switch this to use the
types:
declaration per this, but it does not seem to have an element forstates"
?Also in the tutorial, one had the option to define a different context type for each state and leverage typescript intersection types.
how is all this achievable in V5
As an asside I pinged the
xstate-pinia
folks to see if they were planning to support V5.... wobsoriano/pinia-xstate#3 (comment)Beta Was this translation helpful? Give feedback.
All reactions