Skip to content

Instantly share code, notes, and snippets.

@epan
Last active June 18, 2020 16:52
Show Gist options
  • Save epan/80f7895cfbf517fd2bee643fa416f722 to your computer and use it in GitHub Desktop.
Save epan/80f7895cfbf517fd2bee643fa416f722 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// V3.1
// Transitions, assuming no cancel, no fails, no loading (V3.1)
const simplifiedExistingMachine = Machine({
id: 'simplifiedExisting',
initial: 'closed',
context: {},
states: {
closed: {
on: {
OPEN: 'addressList'
}
},
addressList: {
on: {
SELECT: 'closed',
EDIT_EXISTING: 'addressEdit',
SELECT_NEW: 'addressEdit'
}
},
addressEdit: {
on: {
SAVE: 'closed',
ADJUST_PIN: 'changePinLocation',
CANCEL: 'addressList'
}
},
changePinLocation: {
on: {
SAVE: 'addressEdit',
CANCEL: 'addressEdit'
}
},
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment