Created
July 18, 2020 00:03
-
-
Save ooade/0e1f9313f850ed05d83acf2df5e4d020 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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