Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // Available variables:
  2. // - Machine
  3. // - interpret
  4. // - assign
  5. // - send
  6. // - sendParent
  7. // - spawn
  8. // - raise
  9. // - actions
  10. // - XState (all XState exports)
  11.  
  12. const fetchMachine = Machine({
  13. id: 'fetch',
  14. initial: 'pending',
  15. states: {
  16. pending: {
  17. on: {
  18. ANALYSE: 'waiting_for_acceptance',
  19. REJECT: 'rejected'
  20. }
  21. },
  22. waiting_for_acceptance: {
  23. on: {
  24. APPROVE: 'accepted',
  25. REJECT: 'rejected'
  26. }
  27. },
  28. accepted: {
  29. on: {
  30. REJECT: 'rejected'
  31. }
  32. },
  33. rejected: {
  34. on: {
  35. RETRY: {
  36. target: 'pending'
  37. }
  38. }
  39. }
  40. }
  41. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement