Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. const wiseLoadingMachine = Machine({
  2. id: 'wiseLoadingMachine',
  3. initial: 'idle',
  4. context: {
  5. region: null
  6. },
  7. states: {
  8. idle: {
  9. on: {
  10. setTab: 'settingTab'
  11. }
  12. },
  13. settingTab: {
  14. onEntry: 'setRegion'
  15. },
  16. loading: {
  17. initial: 'loadingUISettings',
  18. on: {
  19. setTab: '#wiseLoadingMachine.settingTab'
  20. },
  21. states: {
  22. loadingUISettings: {
  23. invoke: {
  24. src: 'loadUISettings',
  25. onDone: 'loadingSubmittedSpend'
  26. },
  27. },
  28. loadingSubmittedSpend: {
  29. invoke: {
  30. src: 'loadSubmittedSpend',
  31. onDone: '#wiseLoadingMachine.success'
  32. },
  33. }
  34. }
  35. },
  36. success: {
  37. entry: 'setResult',
  38. on: {
  39. setTab: 'settingTab'
  40. }
  41. }
  42. }
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement