Skip to content

Instantly share code, notes, and snippets.

@dwinston
Created October 16, 2020 18:58
Show Gist options
  • Save dwinston/6fcd9d57a8f0a706dfb09843bd0851f7 to your computer and use it in GitHub Desktop.
Save dwinston/6fcd9d57a8f0a706dfb09843bd0851f7 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: 'metadata submission portal',
initial: 'idle',
context: {
submission_id: null
},
states: {
idle: {
on: {
INPUT: 'editing'
}
},
editing: {
on: {
SUBMIT: 'validating',
SUGGEST: 'editing'
}
},
validating: {
on: {
RESOLVE: 'assigning',
REJECT: 'editing'
}
},
assigning: {
on: {
RESOLVE: 'idle',
REJECT: 'editing'
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment