Skip to content

Instantly share code, notes, and snippets.

@Swizec
Last active August 10, 2020 16:05
Show Gist options
  • Save Swizec/7d8dc2133f897c61857d5509fb780658 to your computer and use it in GitHub Desktop.
Save Swizec/7d8dc2133f897c61857d5509fb780658 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const smolMessMachine = Machine({
id: 'smolMess',
initial: '0-0-0',
states: {
'0-0-0': {
on: {
A: '1-0-0',
B: '0-1-0',
C: '0-0-1'
},
meta: { green: 1, red: 0, blue: 0 }
},
'0-0-1': {
on: {
A: '1-0-1',
B: '0-1-1',
C: '0-0-0'
},
meta: { green: 1, red: 0, blue: 0 }
},
'0-1-0': {
on: {
A: '1-1-0',
B: '0-0-0',
C: '0-1-1'
},
meta: { green: 0, red: 0, blue: 0 }
},
'0-1-1': {
on: {
A: '1-1-1',
B: '1-0-1',
C: '0-1-0'
},
meta: { green: 1, red: 1, blue: 1 }
},
'1-0-0': {
on: {
A: '0-0-0',
B: '1-1-0',
C: '1-0-1'
},
meta: { green: 0, red: 0, blue: 1 }
},
'1-0-1': {
on: {
A: '0-0-1',
B: '1-1-1',
C: '1-0-0'
},
meta: { green: 1, red: 1, blue: 1 }
},
'1-1-0': {
on: {
A: '0-1-0',
B: '1-0-0',
C: '1-1-1'
},
meta: { green: 1, red: 0, blue: 0 }
},
'1-1-1': {
on: {
A: '0-1-1',
B: '1-0-1',
C: '1-1-0'
},
meta: { green: 1, red: 0, blue: 0 }
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment