Skip to content

Instantly share code, notes, and snippets.

@nicolas-besnard
Created February 17, 2023 20:06
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 nicolas-besnard/0907f611c6364cf890b04218d7343654 to your computer and use it in GitHub Desktop.
Save nicolas-besnard/0907f611c6364cf890b04218d7343654 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: 'contract',
initial: 'validatedByClient',
states: {
validatedByClient: {
on: {
CONTRACT_SIGNED: 'pendingVideoUpload'
}
},
pendingVideoUpload: {
on: {
VIDEO_UPLOADED: 'pendingClientValidation',
}
},
pendingClientValidation: {
on: {
VALIDATED_BY_CLIENT: 'pendingVideoPost',
CLIENT_ASK_CHANGES: 'pendingChanges'
}
},
pendingChanges: {
on: {
CHANGED: 'pendingClientValidation'
}
},
pendingVideoPost: {
on: {
VIDEO_POSTED: 'pendingInvoice'
}
},
pendingInvoice: {
on: {
INVOICE_SENT: 'pendingPayment'
}
},
pendingPayment: {
on: {
PAID: 'success'
}
},
success: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment