Last active
September 24, 2020 22:24
-
-
Save halostatue/52ec37cf025ba5093bc4de8b745051fa 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
const agentInfo = { | |
offline: { | |
on: { | |
ONLINE: 'online', | |
GROUP: 'group' | |
} | |
}, | |
group: { | |
on: { | |
ONLINE: 'online', | |
OFFLINE: 'offline' | |
} | |
}, | |
online: { | |
on: { | |
GROUP: 'group', | |
OFFLINE: 'offline' | |
} | |
} | |
}; | |
const chatPrompt = Machine({ | |
id: 'chatPrompt', | |
initial: 'visible', | |
context: { | |
}, | |
states: { | |
visible: { | |
type: 'compound', | |
initial: 'offline', | |
states: { | |
...agentInfo | |
/* online: { | |
type: 'compound', | |
initial: 'unavailable', | |
states: { | |
...agentInfo, | |
unavailable: { | |
on: { | |
AVAILABLE: 'available', | |
} | |
}, | |
available: { | |
on: { | |
UNAVAILABLE: 'unavailable' | |
} | |
} | |
}, | |
on: { | |
OFFLINE: 'offline' | |
} | |
}, | |
offline: { | |
on: { | |
ONLINE: 'online' | |
} | |
}*/ | |
}, | |
on: { | |
CLOSE: 'hidden' | |
} | |
}, | |
hidden: { | |
type: 'final' | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment