Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 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: 'consultation',
  14. initial: 'greeter',
  15. states: {
  16. greeter: {
  17. on: {
  18. NEXT: {
  19. target: 'insuranceTypeBinary',
  20. },
  21. },
  22. meta: {
  23. component: 'greeter',
  24. },
  25. },
  26. insuranceTypeBinary: {
  27. on: {
  28. CREDIT: {
  29. target: 'creditSliders',
  30. },
  31. FAMILY: {
  32. target: 'familySizeRadio',
  33. },
  34. },
  35. meta: {
  36. component: 'radio',
  37. },
  38. },
  39. creditSliders: {
  40. on: {
  41. SHOWADDON: {
  42. target: 'familyAddon',
  43. },
  44. NEXT: {
  45. target: 'insuranceRequirementsInput',
  46. },
  47. },
  48. meta: {
  49. component: 'inputSlider',
  50. },
  51. },
  52. familyAddon: {
  53. on: {
  54. ACCEPT: {
  55. target: 'familySizeRadio',
  56. },
  57. DENY: {
  58. target: 'insuranceRequirementsInput',
  59. },
  60. },
  61. meta: {
  62. component: 'binarySelect',
  63. },
  64. },
  65. creditAddon: {
  66. on: {
  67. ACCEPT: {
  68. target: 'creditSliders',
  69. },
  70. DENY: {
  71. target: 'insuranceRequirementsInput',
  72. },
  73. },
  74. meta: {
  75. component: 'binarySelect',
  76. },
  77. },
  78. familySizeRadio: {
  79. on: {
  80. NEXT: {
  81. target: 'familySliders',
  82. },
  83. },
  84. meta: {
  85. component: 'radio',
  86. },
  87. },
  88. familySliders: {
  89. on: {
  90. SHOWADDON: {
  91. target: 'creditAddon',
  92. },
  93. NEXT: {
  94. target: 'insuranceRequirementsInput',
  95. },
  96. },
  97. meta: {
  98. component: 'inputSlider',
  99. },
  100. },
  101. insuranceRequirementsInput: {
  102. type: 'final',
  103. meta: {
  104. component: 'dualIconInput',
  105. },
  106. },
  107. },
  108. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement