Created
May 8, 2020 10:37
-
-
Save schryer/9d2e36597973a135ea5252f349590215 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
Machine({ | |
initial: 'active', | |
context: { C: undefined, F: undefined }, | |
states: { | |
active: { | |
on: { | |
CELSIUS: { | |
actions: assign({ | |
C: (_, event) => Number(event.value), | |
F: (_, event) => CtoF(event.value) | |
}) | |
}, | |
FAHRENHEIT: { | |
actions: assign({ | |
C: (_, event) => FtoC(event.value), | |
F: (_, event) => Number(event.value) | |
}) | |
} | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment