Created
July 10, 2020 10:15
-
-
Save blinkylights23/c1b3e77766511f9145fe2a0023d79184 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
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