Created
September 27, 2019 19:02
-
-
Save mikaelkaron/f747f04d0bd68338c437ac34c559e0e3 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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
// contrived example - reads from the `context` and sends | |
// the dynamically created event | |
const sendNameObjectFn = send((context, event) => ({ | |
type: 'NAME', | |
name: context.user.name | |
})); | |
const sendNameObject = send({ type: 'NAME' }); | |
const sendNameString = send('NAME'); | |
const machine = Machine({ | |
initial: 'initial', | |
states: { | |
initial: {} | |
}, | |
// ... | |
on: { | |
TOGGLE: { | |
actions: sendNameObject | |
} | |
} | |
//... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment