Replies: 1 comment
-
This is actually a good question, and it's not clear to me why after all this time the creators of Xstate haven't dedicated a chapter to it in the documentation. As I understand it at the moment, a fsm should work in such a way that if there are incorrect calculations outside the fsm, you should:
|
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
-
I have guard functions which perform computations that rely on calling other functions that may result in null/undefined values. Returning null/undefined values should not happen if the system is defined correctly however calling these functions throws ts errors for not doing these checks.
Currently I guess I can just always return false in these checks but I want to know what is the best practice for handling errors within guards? Would it be to just return false in those cases or to throw an error? Or should I somehow transition the state machine to some error state?
Beta Was this translation helpful? Give feedback.
All reactions