Skip to content

Instantly share code, notes, and snippets.

@mergebandit
Last active May 24, 2021 20:18
Show Gist options
  • Save mergebandit/3b90a3966eb2bc9c28962e2fe3bc5a35 to your computer and use it in GitHub Desktop.
Save mergebandit/3b90a3966eb2bc9c28962e2fe3bc5a35 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 statusMachine = Machine({
id: 'status',
initial: 'apply',
context: {
pendingZdoEligibilityChcek: true,
onboardingGroup: 'Normal Merchant',
onboardingStatus: 'IN_REVIEW'
},
states: {
apply: {
initial: 'idle',
states: {
idle: {
after: {
250: 'done'
}
},
done: {
after: {
500: '#status.compliance'
}
}
}
},
compliance: {
initial: 'idle',
states: {
idle: {
always: [
{ target:'reviewing', cond: 'inReview' },
{target: 'done' }
]
},
reviewing: {},
requiresAttention: {},
done: {}
}
},
integration: {},
messaging: {},
shopDirectory: {}
}
}, {
guards: {
inReview: ({ onboardingStatus }) => onboardingStatus === 'IN_REVIEW'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment