Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Available variables:
- // - Machine
- // - interpret
- // - assign
- // - send
- // - sendParent
- // - spawn
- // - raise
- // - actions
- // - XState (all XState exports)
- const fetchMachine = Machine({
- id: 'fetch',
- initial: 'pending',
- states: {
- pending: {
- on: {
- ANALYSE: 'waiting_for_acceptance',
- REJECT: 'rejected'
- }
- },
- waiting_for_acceptance: {
- on: {
- APPROVE: 'accepted',
- REJECT: 'rejected'
- }
- },
- accepted: {
- on: {
- REJECT: 'rejected'
- }
- },
- rejected: {
- on: {
- RETRY: {
- target: 'pending'
- }
- }
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement