Last active
October 9, 2019 23:21
-
-
Save hosmelq/e77d366a0209242f9a15b11bada20112 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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({ | |
initial: `applicant`, | |
name: `applicants.create`, | |
context: { | |
tabIndex: 0 | |
}, | |
states: { | |
applicant: { | |
on: { | |
NEXT: { | |
target: `vehicle`, | |
actions: assign({tabIndex: 1}) | |
} | |
} | |
}, | |
vehicle: { | |
on: { | |
NEXT: { | |
target: `cellphone`, | |
actions: assign({tabIndex: 2}) | |
}, | |
PREV: { | |
target: `applicant`, | |
actions: assign({tabIndex: 0}) | |
} | |
} | |
}, | |
cellphone: { | |
on: { | |
NEXT: { | |
target: `contact`, | |
actions: assign({tabIndex: 3}) | |
}, | |
PREV: { | |
target: `vehicle`, | |
actions: assign({tabIndex: 1}) | |
} | |
} | |
}, | |
contact: { | |
on: { | |
NEXT: { | |
target: `comment`, | |
actions: assign({tabIndex: 4}) | |
}, | |
PREV: { | |
target: `cellphone`, | |
actions: assign({tabIndex: 2}) | |
} | |
} | |
}, | |
comment: { | |
on: { | |
PREV: { | |
target: `contact`, | |
actions: assign({tabIndex: 3}) | |
} | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment