Skip to content

Instantly share code, notes, and snippets.

@dsebastien
Last active November 16, 2020 09:15
Show Gist options
  • Save dsebastien/6acc039df72d5b1a6f3da8427fdb5f9e to your computer and use it in GitHub Desktop.
Save dsebastien/6acc039df72d5b1a6f3da8427fdb5f9e 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 fetchMachine = Machine({
id: 'meetings',
initial: 'draft',
context: {
},
states: {
draft: {
on: {
DELETE: 'deleted',
PLAN_WITH_INVITES: 'planned',
PLAN_WITHOUT_INVITES: 'planned',
START_WITHOUT_INVITES: 'ongoing',
}
},
deleted: {
type: 'final'
},
planned: {
on: {
CANCEL: 'cancelled',
START: 'ongoing'
}
},
cancelled: {
type: 'final'
},
ongoing: {
on: {
PAUSE: 'paused',
STOP: 'finished',
}
},
paused: {
on: {
RESUME: 'ongoing',
STOP: 'finished',
}
},
finished: {
on: {
APPROVE: 'approved'
}
},
approved: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment