Skip to content

Instantly share code, notes, and snippets.

@24601
Last active September 19, 2019 00:54
Show Gist options
  • Save 24601/12176ff6ac635aba4581cf7bae744829 to your computer and use it in GitHub Desktop.
Save 24601/12176ff6ac635aba4581cf7bae744829 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 documentMachine = Machine({
id: 'document',
initial: 'structuring',
context: {
retries: 0
},
states: {
structuring: {
on: {
STRUCTURE_COMPLETE: 'approving_structure'
}
},
approving_structure: {
on: {
STRUCTURE_APPROVED:'filling_out'
,
STRUCTURE_REJECTED:'structuring'
}
},
filling_out: {
on: {
FILLED_OUT:'approving_filled_out'
}
},
approving_filled_out: {
on: {
FILLED_OUT_APPROVED:'signing'
,
FILLED_OUT_REJECTED:'filling_out'
}
},
signing: {
on: {
FULLY_SIGNED:'document_signed',
SIGNATURE_REJECTED:'structuring'
}
},
document_signed: {
on: {
RENDERED:'document_rendered'
}
},
document_sent : {
type:"final"
},
document_rendered: {
on: {
SENT_OUT:'document_sent'
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment