Skip to content

Instantly share code, notes, and snippets.

@rschwabco
Created February 5, 2021 05:29
Show Gist options
  • Save rschwabco/e50a015227ed11fc59d8a2ecf378daf0 to your computer and use it in GitHub Desktop.
Save rschwabco/e50a015227ed11fc59d8a2ecf378daf0 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// 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