Skip to content

Instantly share code, notes, and snippets.

@diegolamanno
Created September 24, 2019 15:42
Show Gist options
  • Save diegolamanno/684a888739c681e69ec2f6b2387dfd8c to your computer and use it in GitHub Desktop.
Save diegolamanno/684a888739c681e69ec2f6b2387dfd8c 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 machine = Machine({
id: 'cart',
initial: 'closed',
states: {
closed: {
on: {
OPEN: 'open',
},
},
open: {
initial: 'pending',
on: {
CLOSE: 'closed',
},
states: {
pending: {
on: {
RESOLVE: 'resolved',
REJECT: 'rejected'
},
},
resolved: {
type: 'final',
},
rejected: {
type: 'final',
}
},
},
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment