Repository navigation
Replies: 1 comment
|
In XState v5, invoked actor failures are delivered as on: {
'xstate.error.actor.*': {
actions: 'console_error',
target: '.error',
},
error: {
actions: 'console_error',
target: '.error',
},
},Place this The plain Also, Tested with XState 5.33.2, including rejected promises, startup throws and local |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
On every state which uses an invoked actor, I have a transition like this:
and then, in addition, on every invoked actor, I have a transition like this:
So if I have 2 states, each of which invokes 3 actors, then I have to use a total of eight transitions just to say "these 2 states should do such-and-such if there's an error".
That's a lot of boilerplate which creates a huge array of transitions that doesn't look very good in the Stately Editor autolayout, to boot.
Is there any way to have something like an
"error:*"transition on a state which has invoked actors, to just have unified handling ofonErrorfor every invoked actor?All reactions