Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generated by XState Viz: https://xstate.js.org/viz
const nestedStates = {
initial: 'a1',
states: {
a1: {
on: {
FOO: "a2"
}
},
a2: {
type: "final"
}
}
};
const machine = Machine({
initial: 'a',
states: {
a: {
onDone: "b",
...nestedStates
},
b: {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment