Last active
May 24, 2021 20:18
-
-
Save mergebandit/3b90a3966eb2bc9c28962e2fe3bc5a35 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
// 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