Created
February 17, 2023 20:06
-
-
Save nicolas-besnard/0907f611c6364cf890b04218d7343654 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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