Skip to content

Instantly share code, notes, and snippets.

@ethan605
Last active April 14, 2021 15:57
Show Gist options
  • Save ethan605/598860891a62fbaa7d2b7f951a874a66 to your computer and use it in GitHub Desktop.
Save ethan605/598860891a62fbaa7d2b7f951a874a66 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const docVideoFlow = Machine({
id: 'docVideo',
type: 'parallel',
states: {
recordState: {
initial: 'hideButton',
states: {
hideButton: {
on: {
NEXT_RECORD_STATE: 'showButton'
}
},
showButton: {
on: {
NEXT_RECORD_STATE: 'holdStill',
RESET_RECORD_STATE: 'hideButton'
}
},
holdStill: {
on: {
NEXT_RECORD_STATE: 'success',
RESET_RECORD_STATE: 'hideButton'
}
},
success: {
type: 'final',
on: {
RESET_RECORD_STATE: 'hideButton'
}
}
}
},
captureStep: {
initial: 'intro',
states: {
intro: {
on: {
NEXT_CAPTURE_STEP: {
target: 'front',
actions: send('RESET_RECORD_STATE')
}
}
},
front: {
on: {
NEXT_CAPTURE_STEP: {
target: 'back',
actions: send('RESET_RECORD_STATE')
},
}
},
back: {
on: {
NEXT_CAPTURE_STEP: {
target: 'confirm',
actions: send('RESET_RECORD_STATE')
},
}
},
confirm: {
type: 'final'
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment