Skip to content

Instantly share code, notes, and snippets.

@awchjimmy
Last active April 22, 2020 02:49
Show Gist options
  • Save awchjimmy/a1db58a4177ebd97854641d61f33ce43 to your computer and use it in GitHub Desktop.
Save awchjimmy/a1db58a4177ebd97854641d61f33ce43 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 phaserCEDocs = {
id: 'unofficial',
initial: 'docs',
states: {
docs: {
on: {
"game": 'game',
"Sprite": "spriteName"
}
},
"game": {
on: {
load: 'game@load'
}
},
"game@load": {
on: {
image: 'game@load@image(key, path)'
}
},
"game@load@image(key, path)": {
type: 'final'
},
'spriteName': {
on: {
visible: "spriteName@visible = true"
}
},
"spriteName@visible = true": {
type: 'final'
}
}
}
const fetchMachine = Machine({
id: 'fetch',
initial: 'idle',
type: 'parallel',
context: {
retries: 0
},
states: {
idle: {
on: {
}
},
loading: {
on: {
RESOLVE: '',
}
},
"phaser-ce": {
...phaserCEDocs
},
"browserify": {
type: 'final'
},
"xstates": {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment