Skip to content

Instantly share code, notes, and snippets.

@mcormier
Last active August 4, 2021 17:38
Show Gist options
  • Save mcormier/d7967fb2a32e9461271f0a070ca33179 to your computer and use it in GitHub Desktop.
Save mcormier/d7967fb2a32e9461271f0a070ca33179 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const pageNavMachine = Machine({
initial: "start",
id: "pageNavigation",
context: {
mugshot_enabled: true
},
states: {
start: {
on: {NEXT: "patient"}
},
patient: {
on: {NEXT: "selection",}
},
selection: {
on: {
NEXT: "sizing_scan_choice",
PREVIOUS: "patient"
}
},
sizing_manual_nose_width: {
on: {
NEXT: "sizing_manual_face_height",
PREVIOUS: "sizing_scan_choice" ,
}
},
sizing_manual_face_height: {
on : {
NEXT: "sizing_manual_nose_depth",
PREVIOUS: "sizing_manual_nose_width"
}
},
sizing_manual_nose_depth: {
on : {
NEXT: "sizing_manual_complete",
PREVIOUS: "sizing_manual_face_height"
}
},
sizing_manual_complete: {
on : {
NEXT: "complete",
PREVIOUS: "sizing_manual_nose_depth",
TRY_AGAIN: "sizing_manual_complete",
ERROR: "error"
}
},
sizing_manual_nose_width_prep: {
on: {
NEXT: "sizing_manual_face_height_prep",
PREVIOUS: "sizing_scan_prep",
}
},
sizing_manual_face_height_prep: {
on : {
NEXT: "sizing_manual_nose_depth_prep",
PREVIOUS: "sizing_manual_nose_width_prep"
}
},
sizing_manual_nose_depth_prep: {
on : {
NEXT: "sizing_manual_complete_prep",
PREVIOUS: "sizing_manual_face_height_prep"
}
},
sizing_manual_complete_prep: {
on : {
NEXT: "complete",
PREVIOUS: "sizing_manual_nose_depth_prep",
TRY_AGAIN: "sizing_manual_complete_prep",
ERROR: "error"
}
},
sizing_scan_choice: {
on : {
PREVIOUS: "selection",
MANUAL: "sizing_manual_nose_width",
NEXT: "sizing_scan_prep",
}
},
sizing_scan_prep: {
on : {
PREVIOUS: "sizing_scan_choice",
MANUAL: "sizing_manual_nose_width_prep",
NEXT: "sizing_scan_take_photo"
}
},
sizing_scan_take_photo: {
on: {
PREVIOUS: "sizing_scan_prep",
FAILED: "sizing_scan_choice",
NEXT: "sizing_scan_take_photo_analyzing"
}
},
sizing_scan_take_photo_analyzing: {
NEXT: "complete"
},
complete: {},
error: {},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment