Skip to content

Instantly share code, notes, and snippets.

@tivac
Created November 8, 2019 06:25
Show Gist options
  • Save tivac/231f9fd173bc95098ce90e3695316bc1 to your computer and use it in GitHub Desktop.
Save tivac/231f9fd173bc95098ce90e3695316bc1 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)
Machine({
initial : "idle",
on : {
"GO" : "go",
},
states : {
idle : {
on : {
// DOTHING is called with event params from service.send()
"DOTHING" : {
actions : raise("GO"),
},
},
},
go : {
// The params from service.send() are still passed through to here
entry : console.log,
on : {
// Can this transition modify & re-include payload data from the "GO" event
// that caused
"" : "go2",
},
},
go2 : {
entry : console.log,
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment