Skip to content

Instantly share code, notes, and snippets.

@radislaw
Last active April 14, 2021 06:09
Show Gist options
  • Select an option

  • Save radislaw/cfb6ae80e5389fa30d806ca1e21ae797 to your computer and use it in GitHub Desktop.

Select an option

Save radislaw/cfb6ae80e5389fa30d806ca1e21ae797 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: 'review',
initial: 'idle',
states: {
idle: {
on: {
RATE: 'rate',
CLOSE: 'finish'
}
},
rate: {
on: {
REVIEW: 'review',
CLOSE: 'finish'
}
},
review: {
on: {
SUCCESS: 'success',
CLOSE: 'finish'
}
},
success: {
on: {
CLOSE: 'finish'
}
},
finish: {
type: 'final',
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment