Created
January 5, 2021 19:03
-
-
Save apostolos/21a27b639ee4323878b9dc0c23689ce6 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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 materialButtonMachine = Machine({ | |
id: 'material-button', | |
initial: 'idle', | |
context: { | |
elapsed: 0 | |
}, | |
states: { | |
idle: { | |
on: { | |
POINTERDOWN: 'down', | |
} | |
}, | |
down: { | |
on: { | |
POINTERUP: 'up', | |
}, | |
after: { | |
300: 'active' | |
} | |
}, | |
active: { | |
on: { | |
POINTERUP: 'up', | |
} | |
}, | |
up: { | |
on: { | |
POINTERDOWN: 'down', | |
}, | |
after: { | |
300: 'idle' | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment