Skip to content

Instantly share code, notes, and snippets.

@blinkylights23
Created July 10, 2020 10:15
Show Gist options
  • Save blinkylights23/c1b3e77766511f9145fe2a0023d79184 to your computer and use it in GitHub Desktop.
Save blinkylights23/c1b3e77766511f9145fe2a0023d79184 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'pub',
initial: 'unpublished',
context: {
arcId: null
},
states: {
unpublished: {
on: {
PUBLISH: {
target: 'published',
actions: ['notifyCMC_RL']
},
DELETE: {
target: 'deleted',
actions: ['notifyCMC_DL']
}
},
meta: {
chosunStatus: 'WT'
}
},
published: {
on: {
PUBLISH: {
target: 'published',
actions: ['notifyCMC_RL']
},
UNPUBLISH: {
target: 'unpublished',
actions: ['notifyCMC_WT']
},
DELETE: {
target: 'deleted',
actions: ['notifyCMC_DL']
}
},
meta: {
chosunStatus: 'RL'
}
},
deleted: {
type: 'final',
meta: {
chosunStatus: 'DL'
}
}
},
actions: {
notifyCMC_RL: (event, context) => {
console.log('Notifying CMC: RL')
},
notifyCMC_WT: (event, context) => {
console.log('Notifying CMC: WT')
},
notifyCMC_DL: (event, context) => {
console.log('Notifying CMC: DL')
}
},
guards: {},
activities: {},
services: {}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment