Skip to content

Instantly share code, notes, and snippets.

@robertvorthman
Last active November 21, 2020 14:52
Show Gist options
  • Save robertvorthman/354fe315f4515ad181c4aca3f0258190 to your computer and use it in GitHub Desktop.
Save robertvorthman/354fe315f4515ad181c4aca3f0258190 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const positionMachine = Machine({
id: 'position',
initial: 'open',
context: {
selectedCandidateId: 0
},
states: {
open: {
on: {
selectCandidate: 'selected'
}
},
selected: {
on: {
award: 'awarded',
reject: 'open',
}
},
awarded: {
on: {
fill: 'filled',
withdrawAwarded: 'open'
}
},
filled: {
type: 'final',
}
}
});
const candidateMachine = Machine({
id: 'submission',
initial: 'incomplete',
context: {
id: 0
},
states: {
incomplete: {
on: {
addQualifications: 'available'
}
},
available: {
on: {
submit: 'submitted'
}
},
submitted: {
on: {
withdraw: 'available',
select: 'selected',
}
},
selected: {
on: {
reject: 'available',
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment