Skip to content

Instantly share code, notes, and snippets.

@sarahdayan
Created October 24, 2020 14:50
Show Gist options
  • Save sarahdayan/c53b38ec9b456ddc2d1b15996183430d to your computer and use it in GitHub Desktop.
Save sarahdayan/c53b38ec9b456ddc2d1b15996183430d to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const editor = Machine({
type: 'parallel',
states: {
sidebar: {
initial: 'expanded',
states: {
expanded: {
on: {
TOGGLE_SIDEBAR: 'collapsed',
},
},
collapsed: {
on: {
TOGGLE_SIDEBAR: 'expanded'
}
},
}
},
preview: {
initial: 'visible',
states: {
visible: {
on: {
TOGGLE_PREVIEW: 'hidden'
},
initial: 'rendered',
states: {
rendered: {
on: {
TOGGLE_PREVIEW_MODE: 'html'
}
},
html: {
on: {
TOGGLE_PREVIEW_MODE: 'rendered'
}
},
memo: {
type: 'history'
}
}
},
hidden: {
on: {
TOGGLE_PREVIEW: 'visible.memo'
}
},
}
}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment