Skip to content

Instantly share code, notes, and snippets.

@nachozt
Last active September 21, 2020 17:39
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 nachozt/2813e457edd00271d5437a20ccf4c14b to your computer and use it in GitHub Desktop.
Save nachozt/2813e457edd00271d5437a20ccf4c14b 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: 'PENDING',
initial: 'PENDING',
states: {
PENDING: {
value: 'PENDING',
on: {
create_deposit_account_success: 'ACTIVE',
create_deposit_account_failed: 'PENDING',
}
},
ACTIVE: {
value: 'ACTIVE',
on: {
block_account: 'BLOCKED',
close: 'CLOSED'
}
},
BLOCKED: {
VALUE: 'BLOCKED',
on: {
unblock_account: 'ACTIVE',
close: 'CLOSED',
}
},
CLOSED: {
value: 'CLOSED'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment