Replies: 1 comment
-
cc. @Andarist |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Similarly to how
setup()
provides a way to specify types fortags
,context
andevents
, is there any way to specify a type forstates
?E.g.:
If I'm not mistaken, the type of
states
would have to be a union ofStateValue
, e.g.:The rationale for this: We have several state machines that observe each other and transition once another machine enters a certain state. I tried obtaining types for the possible states of our machines with this monstrosity:
But, this leads to circular references in the types.
My idea is that if I could declare possible states in advance (as with
tags
), I could use this simple non-derived type in referencing locations and ensure type-safety.Beta Was this translation helpful? Give feedback.
All reactions