Skip to content

Instantly share code, notes, and snippets.

@samzmann
Last active March 2, 2021 16:00
Show Gist options
  • Save samzmann/e994e397620d773af68ffe0dc1273504 to your computer and use it in GitHub Desktop.
Save samzmann/e994e397620d773af68ffe0dc1273504 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: 'fetch',
initial: 'start',
context: {
},
states: {
start: {
on: {
NEXT: 'address'
},
meta: {
screenTitle: null
}
},
address: {
on: {
NEXT: 'addressDetails',
BACK: 'start'
},
meta: {
screenTitle: "Address"
}
},
addressDetails: {
on: {
NEXT: 'name',
BACK: 'start'
}
},
name: {
on: {
NEXT: 'phone',
BACK: 'addressDetails'
}
},
phone: {
on: {
NEXT: 'summary',
BACK: 'addressDetails'
}
},
summary: {
on: {
BACK: 'phone'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment