Skip to content

Instantly share code, notes, and snippets.

@j0k3r
Last active January 6, 2023 15:37
Show Gist options
  • Save j0k3r/53f1c389f9d9a72e3cb235bfec5bbfff to your computer and use it in GitHub Desktop.
Save j0k3r/53f1c389f9d9a72e3cb235bfec5bbfff to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'publication',
initial: 'draft',
states: {
draft: {
on: {
PUBLISH: 'published',
SCHEDULE: 'scheduled',
FROZE: 'frozen',
DELETE: 'deleted',
},
},
scheduled: {
on: {
PUBLISH: 'published',
UNSCHEDULE: 'draft',
},
},
published: {
on: {
UNPUBLISH: 'unpublished',
},
},
unpublished: {
on: {
PUBLISH: 'published',
SCHEDULE: 'scheduled',
},
},
frozen: {
on: {
PUBLISH: 'published',
SCHEDULE: 'scheduled',
},
},
deleted: {
type: 'final',
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment