Skip to content

Instantly share code, notes, and snippets.

@mpowell-atomic
Created February 8, 2020 03:45
Show Gist options
  • Save mpowell-atomic/a02ed2e05ec51a63d7f91cd40fc98c6a to your computer and use it in GitHub Desktop.
Save mpowell-atomic/a02ed2e05ec51a63d7f91cd40fc98c6a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
Machine(
{
id: 'launch',
initial: 'initial',
states: {
initial: {
on: {
SUBMIT: {
target: 'confirmation',
// cond: ( context, event ) => {
// this.formSubmit();
// if ( !this.hasError( 'publish_at' ) ) {
// this.$emit( 'modified' );
// }
// return !this.hasError( 'publish_at' );
// },
},
PUBLISH_NOW: {
actions: 'publishNow',
target: 'publishNow'
},
}
},
confirmation: {
on: {
DATES: {
target: 'initial'
}
}
},
publishNow: {
on: {
SUBMIT: {
actions: 'publishSave'
},
PUBLISH_NOW: {
target: 'initial'
},
PREVIOUS: {
target: 'initial',
actions: 'unpublishNow'
}
}
},
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment