Created
December 2, 2019 23:32
-
-
Save tbigueres/b0a73f0684d962ed457625e658ede860 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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) | |
function paymentStatusWaitingForMoreInformation(context) { | |
if(context.status == "PAYMENT_WAITING_FOR_MORE_INFORMATION"); | |
} | |
function paymentStatusWaitingForReconciliation(context) { | |
if(context.status == "PAYMENT_WAITING_FOR_RECONCILIATION"); | |
} | |
function changeState(context) { | |
} | |
const fetchMachine = Machine({ | |
id: 'clientPaymentDrawer', | |
initial: 'idle', | |
context: { | |
status: "PAYMENT_WAITING_FOR_MORE_INFORMATION" | |
}, | |
states: { | |
idle: { | |
on: { | |
OPEN: [{ | |
on: "paymentStatusWaitingForMoreInformation", | |
target:"choose_a_client_screen" | |
}, { | |
on: "paymentStatusWaitingForReconciliation", | |
target:"waiting_for_reconciliation_screen" | |
}, | |
] | |
} | |
}, | |
choose_a_client_screen: { | |
on: { | |
CHOOSE_THE_CLIENT: 'validate_the_client_screen', | |
CANCEL: 'idle' | |
} | |
}, | |
validate_the_client_screen: { | |
on: { | |
CLICK_ON_VALIDATE: "validating_the_client_call" , | |
CANCEL: "idle" | |
} | |
}, | |
validating_the_client_call: { | |
on: { | |
VALIDATED: "waiting_for_reconciliation_screen" , | |
} | |
}, | |
waiting_for_reconciliation_screen: { | |
on: { | |
EDIT_THE_CLIENT: 'choose_a_client_screen' | |
} | |
}, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment