Skip to content

Instantly share code, notes, and snippets.

@apostolos
Created January 5, 2021 19:03
Show Gist options
  • Save apostolos/21a27b639ee4323878b9dc0c23689ce6 to your computer and use it in GitHub Desktop.
Save apostolos/21a27b639ee4323878b9dc0c23689ce6 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 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