Skip to content

Instantly share code, notes, and snippets.

@davidkpiano
Created August 7, 2020 03:33
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 davidkpiano/9face6ebec0326fa38434596cd32a723 to your computer and use it in GitHub Desktop.
Save davidkpiano/9face6ebec0326fa38434596cd32a723 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const A1 = () => console.log('Action A1');
const machine = Machine({
initial: 's1',
states: {
h: { type: 'history' },
s1: {on: {E11: 's2'}},
s2: {on: {E11: 's3'}},
s3: {on: {E11: 's4'}},
s4: {/* ... */}
},
on: {
E1: {
target: 'h',
actions: [A1, send('E11')]
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment