Skip to content

Instantly share code, notes, and snippets.

@ooade
Created July 18, 2020 00:03
Show Gist options
  • Save ooade/0e1f9313f850ed05d83acf2df5e4d020 to your computer and use it in GitHub Desktop.
Save ooade/0e1f9313f850ed05d83acf2df5e4d020 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: 'button',
initial: 'solid',
states: {
solid: {
initial: 'idle',
on: {
SWITCH_STATE: 'outline'
},
states: {
idle: {
on: {
MOUSE_OVER: 'hover'
}
},
hover: {
on: {
MOUSE_OUT: 'idle'
}
}
}
},
outline: {
initial: 'idle',
on: {
SWITCH_STATE: 'solid'
},
states: {
idle: {
on: {
MOUSE_OVER: 'hover'
}
},
hover: {
on: {
MOUSE_OUT: 'idle'
}
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment