Skip to content

Instantly share code, notes, and snippets.

@bwaidelich
Created May 25, 2021 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwaidelich/dc44e6abbf977faaba4b506296790fc1 to your computer and use it in GitHub Desktop.
Save bwaidelich/dc44e6abbf977faaba4b506296790fc1 to your computer and use it in GitHub Desktop.
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