Last active
July 17, 2020 12:01
-
-
Save taktran/5fb8a6228690f36d9a18eae1a16c36ae to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const workflowStatusMachine = Machine({ | |
id: 'workflowStatus-v2-with-scheduled-publish', | |
initial: 'draft', | |
states: { | |
draft: { | |
on: { | |
PUBLISH: 'published', | |
SCHEDULE_PUBLISH: 'schedulePublished', | |
} | |
}, | |
published: { | |
initial: 'noChanges', | |
states: { | |
noChanges: { | |
on: { | |
UPDATE_CONTENT: 'hasChanges' | |
} | |
}, | |
hasChanges: { | |
on: { | |
REPUBLISH: 'noChanges' | |
} | |
} | |
}, | |
on: { | |
UNPUBLISH: 'unpublished', | |
} | |
}, | |
schedulePublished: { | |
on: { | |
SCHEDULED_PUBLISH: 'published' | |
} | |
}, | |
unpublished: { | |
on: { | |
REPUBLISH: 'published', | |
SCHEDULE_PUBLISH: 'schedulePublished', | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment