Created
February 5, 2021 05:29
-
-
Save rschwabco/e50a015227ed11fc59d8a2ecf378daf0 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const getChannel = () => {} | |
const fetchMachine = Machine({ | |
id: "root", | |
context: { | |
channel: getChannel() | |
}, | |
states: { | |
"Standup Bot": { | |
id: "Standup Bot", | |
states: { | |
idle: { | |
id: "idle", | |
states: {}, | |
on: { ready: "#listening to messages" }, | |
}, | |
"listening to messages": { | |
id: "listening to messages", | |
states: {}, | |
on: { | |
"message.hello": "#intent-hello", | |
"message.what's up": "#intent-hello" | |
}, | |
}, | |
"intent-hello": { | |
id: "intent-hello", | |
entry: ['sayHello'], | |
type: 'final' | |
}, | |
}, | |
initial: "idle", | |
on: {}, | |
}, | |
}, | |
initial: "Standup Bot", | |
on: {}, | |
}, { | |
actions: { | |
sayHello: (context, event) => { | |
const { channel } = context | |
channel.send("Hello") | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment