Skip to content

Instantly share code, notes, and snippets.

@felippenardi
Created September 20, 2019 14:27
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 felippenardi/a1ec440adba78653d29ce2da52e19f8c to your computer and use it in GitHub Desktop.
Save felippenardi/a1ec440adba78653d29ce2da52e19f8c 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 fetchMachine = Machine({
id: 'sidebar',
initial: 'blocksList',
states: {
blocksList: {
on: {
EDIT_ACTIVE_CONFIGURATION: 'activeConfigurationEditor'
}
},
activeConfigurationEditor: {
on: {
SHOW_ALL_CONFIGURATIONS: 'configurationsList',
BACK: 'blocksList',
}
},
configurationsList: {
on: {
BACK: 'activeConfigurationEditor',
EDIT_CONFIGURATION: 'inactiveConfigurationEditor',
CREATE_CONFIGURATION: 'newConfigurationForm',
}
},
inactiveConfigurationEditor: {
on: {
BACK: 'configurationsList',
SAVE: 'configurationsList',
}
},
newConfigurationForm: {
on: {
BACK: 'configurationsList',
SAVE: 'configurationsList'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment