#Is it possible to declare global machine events in stately studio?
1 messages · Page 1 of 1 (latest)
Just put .on on the top level of the machine before defining any states
☝️ Yes, exactly:
const machine = createMachine({
on: {
unrecoverable_error: {
actions: () => console.error('oh noooooo')
}
},
initial: 'whatever',
states: {
whatever: {...},
another: { ... }
}
});
ah i see, i figured I could do that directly with xstate, but is it possible to model that using the editor? thank you for the responses 🙇
In the editor, you can also have "root transitions"
awesome! where can i find it?
See "Self-transition"?
I guess that should just be "Transition" now that I think about it
ah okay!