Skip to content

Instantly share code, notes, and snippets.

@nhducit
Created April 21, 2020 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhducit/f5a74e1bbf34270283806ad8445b7e9c to your computer and use it in GitHub Desktop.
Save nhducit/f5a74e1bbf34270283806ad8445b7e9c to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: 'fetch',
initial: 'wip',
context: {
retries: 0
},
states: {
wip: {
on: {
'READY/CI_PASSED': 'ready_to_review'
}
},
ready_to_review: {
on: {
NEED_FIX: 'need_fix',
APPROVE: 'code_approve'
}
},
conflict_ci: {
on: {
FIXED: 'ready_to_review',
}
},
need_fix: {
on: {
FIXING: 'wip',
}
},
code_approve: {
on: {
DEPLOY_TO_STAGE: 'staging',
}
},
staging: {
on: {
VERIFIED: 'qa_signed_off',
}
},
qa_signed_off: {
on: {
MERGED: 'merged',
}
},
merged: {
on: {
DEPLOY: 'deployed',
}
},
deployed: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment