Skip to content

Instantly share code, notes, and snippets.

@danabrams
Last active September 9, 2020 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danabrams/4cd7a3bb98c060479404db5485fdebbf to your computer and use it in GitHub Desktop.
Save danabrams/4cd7a3bb98c060479404db5485fdebbf 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 recordPlayer = Machine({
id: 'recordPlayer',
initial: 'noRecord',
states: {
noRecord: {
on: {
LOAD: 'notPlaying'
}
},
notPlaying: {
on: {
PLAY: 'playing',
UNLOAD: 'noRecord'
}
},
playing: {
on: {
STOP: 'notPlaying',
ENDS: 'notPlaying'
}
}
}
})
const actualRecordPlayer = {
motorSpinning: true,
armDown: true,
armAngle: 60.7,
hasRecord: true
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment