Last active
March 2, 2021 16:00
-
-
Save samzmann/e994e397620d773af68ffe0dc1273504 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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