Created
April 5, 2020 02:35
-
-
Save jacobparis/364dea11f6cc0e1692ca139085f41fae 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: { | |
initial: 'left', | |
states: { | |
left: { | |
on: { | |
CENTER: 'center', | |
RIGHT: 'right', | |
JUSTIFY: 'justify' | |
} | |
}, | |
center: { | |
on: { | |
LEFT: 'left', | |
RIGHT: 'right', | |
JUSTIFY: 'justify' | |
} | |
}, | |
right: { | |
on: { | |
LEFT: 'left', | |
CENTER: 'center', | |
JUSTIFY: 'justify' | |
} | |
}, | |
justify: { | |
on: { | |
LEFT: 'left', | |
CENTER: 'center', | |
RIGHT: 'right' | |
} | |
} | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment