Skip to content

Instantly share code, notes, and snippets.

@schryer
Created May 8, 2020 10:37
Show Gist options
  • Save schryer/9d2e36597973a135ea5252f349590215 to your computer and use it in GitHub Desktop.
Save schryer/9d2e36597973a135ea5252f349590215 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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