Skip to content

Instantly share code, notes, and snippets.

@srikanthkyatham
Last active February 11, 2020 13:22
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 srikanthkyatham/01c2d743c200ca3fcec1c651cfc55e50 to your computer and use it in GitHub Desktop.
Save srikanthkyatham/01c2d743c200ca3fcec1c651cfc55e50 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 transferMachine = Machine({
id: "transfer",
initial: "inactive",
states: {
inactive: {
on: {
MEMBER: "member",
SINGLE_ACCOUNT: "single_account",
BEFORE_10th: "before_10th",
OWNER_ACCOUNTS: "owner_accounts"
}
},
member: {},
single_account: {},
before_10th: {},
owner_accounts: {
on: { SINGLE_ACCOUNT_SELECTED: "single_account_selected" }
},
single_account_selected: {
on: { SECOND_ACCOUNT_SELECTED: "second_account_selected" }
},
second_account_selected: {
on: {
TRANSFER_SUCESS: "transfer_success",
TRANSFER_ERROR: "transfer_error"
}
},
transfer_success: {},
transfer_error: {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment