Skip to content

Instantly share code, notes, and snippets.

@matbee-eth
Last active November 6, 2019 15:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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