Created
May 14, 2020 09:52
-
-
Save sp3ber/d5f2c8cc726b7b60d036d80559749f6e 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
| Machine( | |
| { | |
| id: 'osagoReport', | |
| initial: 'introduction', | |
| context: { | |
| }, | |
| states: { | |
| introduction: { | |
| on: { | |
| NEXT: 'chooseFormalizedWay', | |
| }, | |
| }, | |
| chooseFormalizedWay: { | |
| on: { | |
| NEXT: [ | |
| { | |
| target: 'euro', | |
| cond: (context, args) => { | |
| return; | |
| return args.values.formalizedWay === 'euro'; | |
| }, | |
| }, | |
| { | |
| target: 'gibdd', | |
| cond: (context, args) => { | |
| return; | |
| return args.values.formalizedWay === 'gibdd'; | |
| }, | |
| }, | |
| { | |
| target: 'notFormalized', | |
| cond: (context, args) => { | |
| return; | |
| return args.values.formalizedWay === 'noop'; | |
| }, | |
| }, | |
| ], | |
| BACK: 'introduction', | |
| }, | |
| }, | |
| gibdd: { | |
| initial: 'chooseCauser', | |
| states: { | |
| chooseCauser: { | |
| on: { | |
| BACK: '#osagoReport.chooseFormalizedWay', | |
| NEXT: 'when', | |
| }, | |
| }, | |
| when: { | |
| on: { | |
| BACK: 'chooseCauser', | |
| NEXT: { | |
| actions: 'submit', | |
| }, | |
| }, | |
| }, | |
| }, | |
| }, | |
| euro: { | |
| initial: 'chooseCauser', | |
| states: { | |
| chooseCauser: { | |
| on: { | |
| NEXT: 'chooseCrash', | |
| BACK: '#osagoReport.chooseFormalizedWay', | |
| }, | |
| }, | |
| chooseCrash: { | |
| on: { | |
| NEXT: 'when', | |
| BACK: 'chooseCauser', | |
| }, | |
| }, | |
| when: { | |
| on: { | |
| BACK: 'chooseCrash', | |
| NEXT: { | |
| actions: 'submit', | |
| }, | |
| }, | |
| }, | |
| }, | |
| }, | |
| notFormalized: { | |
| on: { | |
| BACK: 'chooseFormalizedWay', | |
| }, | |
| }, | |
| }, | |
| }, | |
| { | |
| actions: { | |
| submit: (context, { values: formValues }) => { | |
| alert(JSON.stringify(formValues)); | |
| }, | |
| }, | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment