Skip to content

Instantly share code, notes, and snippets.

@robertpenner
Last active August 6, 2021 00:58
Show Gist options
  • Save robertpenner/9c88e5b517046c615a44a56c318e92bd to your computer and use it in GitHub Desktop.
Save robertpenner/9c88e5b517046c615a44a56c318e92bd to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'Tournament events during',
initial: 'Practice',
states: {
'Practice': {
initial: 'round 1',
states: {
'round 1': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
on: { 'START NEXT ROUND': 'round 2' },
},
'round 2': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
},
},
on: { 'START NEXT EVENT': 'Tuesday ProAm' },
},
'Tuesday ProAm': {
initial: 'round 1',
states: {
'round 1': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
},
},
on: { 'START NEXT EVENT': 'Wednesday ProAm' },
},
'Wednesday ProAm': {
initial: 'round 1',
states: {
'round 1': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
},
},
on: { 'START NEXT EVENT': 'AT&T' },
},
'AT&T': {
initial: 'round 1',
states: {
'round 1': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
on: { 'START NEXT ROUND': 'round 2' },
},
'round 2': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
on: { 'START NEXT ROUND': 'round 3' },
},
'round 3': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
on: { 'START NEXT ROUND': 'round 4' },
},
'round 4': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
// on: { 'START NEXT ROUND': 'round 3' },
},
},
on: { 'START NEXT EVENT': 'AT&T Playoff' },
},
'AT&T Playoff': {
initial: 'round 1',
states: {
'round 1': {
initial: 'playing',
states: {
'playing': {
on: { 'DONE PLAY': 'complete' },
},
complete: {},
},
},
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment