Skip to content

Instantly share code, notes, and snippets.

@dwinston
Created Oct 16, 2020
Embed
What would you like to do?
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