Created
November 30, 2019 17:25
-
-
Save andrewgordstewart/bb478f9e07520d3de15d96e273403486 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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
const config = { | |
key: 'virtual-funding-as-hub', | |
initial: 'createChannels', | |
states: { | |
createChannels: { | |
entry: 'assignChannels', | |
type: 'parallel', | |
states: { | |
createLeftGuarantorChannel: { | |
invoke: { src: 'createNullChannel', data: 'guarantorChannelArgs' }, | |
}, | |
createRightGuarantorChannel: { | |
invoke: { src: 'createNullChannel', data: 'guarantorChannelArgs' }, | |
}, | |
createJointChannel: { | |
invoke: { src: 'createNullChannel', data: 'jointChannelArgs' }, | |
}, | |
}, | |
onDone: 'fundGuarantors', | |
}, | |
fundGuarantors: { | |
type: 'parallel', | |
states: { | |
fundLeftGuarantor: { | |
invoke: { src: 'supportState', data: 'guarantorOutcome' }, | |
}, | |
fundRightGuarantor: { | |
invoke: { src: 'supportState', data: 'guarantorOutcome' }, | |
}, | |
}, | |
onDone: 'fundTarget', | |
}, | |
fundTarget: { | |
invoke: { src: 'supportState', data: 'jointOutcome', onDone: 'success' }, | |
}, | |
success: { type: 'final' }, | |
}, | |
}; | |
const guards = {}; | |
const customActions = {}; | |
const machine = Machine(config, { guards, actions: customActions }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment