Skip to content

Instantly share code, notes, and snippets.

@jacobparis
Last active April 5, 2020 02:53
Show Gist options
  • Save jacobparis/b020d1096efd3dbc3aa9868894604392 to your computer and use it in GitHub Desktop.
Save jacobparis/b020d1096efd3dbc3aa9868894604392 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 formatMachine = Machine({
id: 'format',
type: 'parallel',
states: {
bold: {
initial: 'off',
states: {
on: {
on: {
BOLD: 'off'
}
},
off: {
on: {
BOLD: 'on'
}
}
}
},
italic: {
initial: 'off',
states: {
on: {
on: {
ITALICIZE: 'off'
}
},
off: {
on: {
ITALICIZE: 'on'
}
}
}
},
underlined: {
initial: 'off',
states: {
on: {
on: {
UNDERLINE: 'off'
}
},
off: {
on: {
UNDERLINE: 'on'
}
}
}
},
align: {
on: {
LEFT: 'align.left',
CENTER: 'align.center',
RIGHT: 'align.right',
JUSTIFY: 'align.justify'
},
initial: 'left',
states: {
left: {},
center: {},
right: {},
justify: {}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment