xState v5 : subscribe to snapshot does not trigger when an invoked actor change state #5117
Unanswered
florian-mollin-wanteeed
asked this question in
Q&A
Replies: 1 comment
-
Yes, use the inspect API: actor.system.inspect(inspectionEvent => {
// This is called whenever anything happens in any actor within the system
}) |
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
-
To persist an actor's snapshot, we use the following code from the doc:
Our actor uses an invoked machine actor.
We need to persist the whole state (main + sub machines) whenever either machine changes states. However, with the current code, it only does so when the main machine changes state.
Is there a way to achieve our desired behaviour?
Beta Was this translation helpful? Give feedback.
All reactions