Replies: 2 comments 8 replies
-
Isn't this already possible today with this: await waitFor(actor, state => state.done) |
Beta Was this translation helpful? Give feedback.
2 replies
-
@mattpocock Any thoughts/ideas on this? Perhaps if you have an idea for a solution and can point me in the right direction in the code I can have a crack at it? Thanks! 🙏 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using
waitFor
on the backend, it would be great to be able to ensure that all final states are handled (possibly using something like https://github.com/gvergnaud/ts-pattern#exhaustive).@mattpocock suggested in the discord that something like the following could be implemented in typegen:
type RootFinalStatesFrom<typeof machine> = ...
Perhaps a more specific
waitFor
could be implemented that waits for final states? For example,Or maybe
finalState.matches()
needs to have its argument constrained to"User found" | "User not found"
but I'm not sure how an exhaustive check would work then using either a switch statement or a pattern matching library like [ts-pattern](https://github.com/gvergnaud/ts-pattern#exhaustive). 🤔Beta Was this translation helpful? Give feedback.
All reactions