Created
January 23, 2020 21:02
-
-
Save amypellegrini/cb8f4f239d4c23ef1c9c5d41cd2e8e84 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
const scaleChartGeneratorMachine = Machine({ | |
id: 'scale-chart-generator', | |
initial: 'default', | |
context: { | |
musicKey: undefined, | |
scaleName: undefined, | |
withKeySignature: false, | |
}, | |
states: { | |
default: { | |
on: { | |
SELECT_SCALE: { | |
target: 'selectedScale', | |
}, | |
TOGGLE_KEY_SIGNATURE: { | |
target: 'default', | |
}, | |
}, | |
}, | |
selectedScale: { | |
on: { | |
SELECT_SCALE: { | |
target: 'selectedScale', | |
}, | |
RESET: { | |
target: 'default', | |
}, | |
SELECT_MUSIC_KEY: { | |
target: 'showScaleChart', | |
}, | |
TOGGLE_KEY_SIGNATURE: { | |
target: 'selectedScale', | |
}, | |
}, | |
}, | |
showScaleChart: { | |
on: { | |
SELECT_SCALE: { | |
target: 'selectedScale', | |
}, | |
RESET: { | |
target: 'default', | |
}, | |
RESET_MUSIC_KEY: { | |
target: 'selectedScale', | |
}, | |
SELECT_MUSIC_KEY: { | |
target: 'showScaleChart', | |
}, | |
TOGGLE_KEY_SIGNATURE: { | |
target: 'showScaleChart', | |
}, | |
}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment