Skip to content

Instantly share code, notes, and snippets.

@benhinchley
Last active November 12, 2019 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benhinchley/409ad7e73df32ace3c7230ff53f2f0b7 to your computer and use it in GitHub Desktop.
Save benhinchley/409ad7e73df32ace3c7230ff53f2f0b7 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 machine = Machine({
id: 'editable-step',
initial: 'collapsed',
context: {
},
states: {
collapsed: {
on: {
EXPAND: 'expanded'
}
},
expanded: {
on: {
COLLAPSE: 'collapsed',
},
initial: "readonly",
states: {
readonly: {
on: {
EDIT: "readwrite"
}
},
readwrite: {
on: {
STAGE: "readonly"
}
}
}
}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment