Skip to content

Instantly share code, notes, and snippets.

@bmeck

bmeck/machine.js

Last active Feb 20, 2020
Embed
What would you like to do?
Generated by XState Viz: https://xstate.js.org/viz
const workflow = Machine({
id: "workflow",
initial: "running",
states: {
running: {
id: "file",
type: "parallel",
states: {
upload: {
initial: "idle",
states: {
idle: {
on: {
INIT_UPLOAD: "pending"
}
},
pending: {
on: {
UPLOAD_COMPLETE: "success"
}
},
success: {
type: 'final'
}
}
},
download: {
initial: "idle",
states: {
idle: {
on: {
INIT_DOWNLOAD: "pending"
}
},
pending: {
on: {
DOWNLOAD_COMPLETE: "success"
}
},
success: {
type: 'final'
}
}
}
},
onDone: "done"
},
done: {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment