Last active
November 28, 2019 13:18
-
-
Save InsOpDe/cc961ae1366d4399138bbd37efdad312 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 contactMachine = Machine({ | |
id: 'contact', | |
initial: 'wayOfContact', | |
states: { | |
wayOfContact: { | |
on: { | |
WE_CALL: 'threeColumns', | |
YOU_CALL: 'ourNumber', | |
YOU_MAIL: 'ourMail' | |
} | |
}, | |
ourNumber: { | |
type: 'final' | |
}, | |
ourMail: { | |
type: 'final' | |
}, | |
threeColumns: { | |
on: { | |
BACK: 'wayOfContact', | |
ASSESSMENT: 'assessment', | |
CONSULTING: 'consulting', | |
PROCESS: 'process', | |
DONT_KNOW: 'dontKnow' | |
} | |
}, | |
assessment: { | |
on: { | |
BACK: 'threeColumns', | |
NOTHING_SELECTED: 'noSelection', | |
FORWARD: 'contactForm' | |
} | |
}, | |
consulting: { | |
on: { | |
BACK: 'threeColumns', | |
NOTHING_SELECTED: 'noSelection', | |
FORWARD: 'contactForm' | |
} | |
}, | |
process: { | |
on: { | |
BACK: 'threeColumns', | |
NOTHING_SELECTED: 'noSelection', | |
FORWARD: 'contactForm' | |
} | |
}, | |
dontKnow: { | |
on: { | |
BACK: 'threeColumns', | |
FORWARD: 'noSelection' | |
} | |
}, | |
noSelection: { | |
on: { | |
BACK: 'threeColumns', | |
FORWARD: 'specify' | |
} | |
}, | |
specify: { | |
on: { | |
BACK: 'threeColumns', | |
FORWARD: 'contactForm' | |
} | |
}, | |
contactForm: { | |
on: { | |
BACK: 'threeColumns', | |
FORWARD: 'success' | |
} | |
}, | |
success: { | |
type: 'final' | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment