Skip to content

Instantly share code, notes, and snippets.

@matbee-eth
Last active November 6, 2019 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matbee-eth/a32549cf0b4b7b967804715995e56ef4 to your computer and use it in GitHub Desktop.
Save matbee-eth/a32549cf0b4b7b967804715995e56ef4 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const initialState = {
id: 'toggle',
initial: 'idle',
context: {
msg: ''
},
states: {
idle: {
on: {
DONE_AVAILABLE: "granted",
DONE_REQUEST: "request",
FAIL: "fail"
}
},
granted: {
type: 'final'
},
request: {
on: {
DONE_AVAILABLE: "granted",
FAIL: "fail"
}
},
fail: {
type: 'final'
}
}
}
Machine(initialState)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment