xstate v5: a "before stop" action? #4801
-
I have two machines, A and B. A is the "root" machine. B is stateless and only sends & receives events. A spawns B in response to an event. In response to a later event, A stops B via Is it possible to configure B such that it executes a final action just before it is stopped--e.g., log that it is stopping? Would I need to add states to B to make something like this work? For example, send an event from A to B which causes B to enter a final state, then call I've tried adding an |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I suppose an |
Beta Was this translation helpful? Give feedback.
-
@davidkpiano @Andarist Regarding a potential It looks like |
Beta Was this translation helpful? Give feedback.
I suppose an
onStop: { … }
transition could be helpful here (cc. @Andarist)