Skip to content

Instantly share code, notes, and snippets.

@Javarome
Last active December 22, 2019 18:57
Show Gist options
  • Save Javarome/e56cf140427a381b96b856f3969448e1 to your computer and use it in GitHub Desktop.
Save Javarome/e56cf140427a381b96b856f3969448e1 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const knMachine = Machine({
id: 'knowledge',
initial: 'created',
states: {
/**
* created or modified
*/
created: {
after: {
500: 'saved',
},
},
/**
* created or modified
*/
saved: {
on: {
EDIT: 'editing',
PUBLISH: 'to_publish',
DELETE: 'deleting',
},
},
editing: {
after: {
500: 'saving',
},
},
deleting: {
after: {
500: 'deleted',
},
},
saving: {
after: {
500: 'saved',
},
},
/**
* validated, marked for publication (to include in training batch)
*/
to_publish: {
on: {
PUBLISH_DONE: 'published',
},
},
/**
* trained has finished ;;
* sync with the assistant
*/
published: {},
deleted: {type: 'final'},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment