Last active
April 5, 2020 02:53
-
-
Save jacobparis/b020d1096efd3dbc3aa9868894604392 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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