Skip to content

Instantly share code, notes, and snippets.

@Faliszek
Last active June 14, 2022 13:03
Show Gist options
  • Save Faliszek/f51d98ad7c2d40c9430271edeabf0c8e to your computer and use it in GitHub Desktop.
Save Faliszek/f51d98ad7c2d40c9430271edeabf0c8e 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 fetchMachine = Machine({
id: 'chrome-extension',
initial: 'idle',
context: {
threadTarget: null
},
states: {
idle: {
on: {
PICK_CAPTURE_MODE: {
"screenshot": {},
"screenshot_delayed": {},
"recording": {},
"recording_fullscreen": {},
"rewind": {}
}
}
},
onboarding: {
on: {
finish: {
"screenshot": {},
}
}
},
screenshot: {
on: {
exit: 'idle',
},
action: assign({
threadTarget: (context, event) => context.threadTarget
})
},
screenshot_delayed: {
on: {
exit: 'idle',
}
},
recording: {
on: {
exit: 'idle'
}
},
recording_fullscreen: {
on: {
exit: 'idle'
}
},
rewind: {
on: {
exit: 'idle'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment