Last active
January 27, 2021 02:39
-
-
Save yy-dev7/19a5dbe60dac21a6b739200b22c2d3ab 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
const surveyMachine = Machine({ | |
id: 'survey', | |
initial: 'index', | |
states: { | |
index: { | |
on: { | |
VERIFICATION_ACTIVE: 'verification', | |
VERIFICATION_INACTIVE: 'start', | |
} | |
}, | |
verification: { | |
type: 'compound', | |
initial: 'page1', | |
states: { | |
page1: { | |
on: { | |
NEXT: 'page2', | |
} | |
}, | |
page2: { | |
on: { | |
AGREE: 'page3', | |
DISAGREE: '#abnormalEnd', | |
} | |
}, | |
page3: { | |
on: { | |
AGREE: '#start', | |
DISAGREE: '#abnormalEnd', | |
} | |
}, | |
} | |
}, | |
start: { | |
id: 'start', | |
on: { | |
SKIP_WELCOME: 'answer', | |
WELCOME: 'welcome', | |
} | |
}, | |
welcome: { | |
id: 'welcome', | |
on: { | |
NEXT: 'answer' | |
} | |
}, | |
answer: { | |
on: { | |
NON_RECOVERABLE: 'abnormalEnd', | |
RECOVERABLE: 'end' | |
} | |
}, | |
end: { | |
type: 'final' | |
}, | |
abnormalEnd: { | |
id: 'abnormalEnd', | |
type: 'final' | |
}, | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment