Skip to content

Instantly share code, notes, and snippets.

@DroopyTersen
Last active January 16, 2020 17:26
Show Gist options
  • Save DroopyTersen/1fc8554360c09b4592d6347d6fdcb463 to your computer and use it in GitHub Desktop.
Save DroopyTersen/1fc8554360c09b4592d6347d6fdcb463 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'milkSourceMileageCollection',
initial: 'OPEN',
states: {
OPEN: {
on: {
"sumbit:mileage": "SUBMITTED",
"notify:transfer": 'TRANSFER_NEEDED'
}
},
SUBMITTED: {
on: {
"create:success": 'CLOSED',
"create:error": 'FAILED'
}
},
CLOSED: {
type: 'final'
},
TRANSFER_NEEDED: {
on: {
'asset:located': "CLOSED"
}
},
FAILED: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment