Replies: 1 comment 1 reply
-
Interesting idea; with observables as an analogy, you basically want to map/filter over the "emitted" values of the actor, and listen for those specific values, right? One nice addition that is coming to v5 is // TENTATIVE v5 API
invoke: {
src: someMachine,
onSnapshot: {
actions: (ctx, { data }) => {
// `data` is the snapshot value
}
}
} So that would be the first step to doing what you want; you can add a Alright, this gives me some good food for thought. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A lot of the time when I assign a new value in an invoked actor, I would like to reflect some portion of that in the parent.
When using
sync: true
, xstate.update fires for every change to an invoked actor. It would be nice if there was anxstate.assign
orxstate.context
event andxstate.state
to distinguish between a change to context and state.Alternatively, something like
assignAndSendToParent
would also be helpful.Beta Was this translation helpful? Give feedback.
All reactions