-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exit action is not triggered on child machine #1109
Comments
I can confirm that this should be fired as per |
I tried to do a workaround by using an "a" state exit hook, unfortunately id doesn't work either. const childMachine = Machine({
entry: () => { console.log('entry') },
// this is not trigerred
exit: () => { console.log('exit') },
initial: 'a',
states: {
a: {
type: 'final',
// this is not triggered either
exit: () => { console.log('"a" state exit')}
}
}
}) |
Im looking into fixing this and while this is on fact defined behavior in SCXML Im wondering - what is your exact real life use case for this? Im trying to think through what unexpected things this change might cause for people. |
Related to #1111? |
Not quite - when looking at #1111 resolution. This is about what we were discussing today - aligning with SCXML spec by calling onExit handlers for canceled/finalized machines. I hope to get this done this week. |
Just bumped into this too. Here's my example use case: a child machine that acquires microphone access using |
Description
Child machine runs using invoke on parent machine. Child machine has exit action defined.
Expected Result
I expect child machine exit action to trigger after it reaches it final state
Actual Result
Exit action on child machine is not fired
Reproduction
https://xstate.js.org/viz/?gist=5ebf91269382bbd3e0bc66c62643a2fa
The text was updated successfully, but these errors were encountered: