Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. Unhandled Rejection (TypeError): dispatch is not a function
  2.  
  3. export function getStatus(requestId) {
  4. return async dispatch => {
  5. let url = GET_UPLOADED_STATUS_URL + requestId;
  6. let response = await get(url);
  7. const timeout = setTimeout(getStatus(requestId), 2000);
  8. if (response.status === 200) {
  9. let total = response.payload.count;
  10. let totalCompleted = response.payload.uploadCompleted
  11. dispatch({
  12. type: UPDATE_PROGRESS_BAR_STATUS,
  13. total: total,
  14. completed: totalCompleted
  15. })
  16. if (!response.payload == "") {
  17. toastr.info(`Total processed ${totalCompleted}`);
  18. }
  19. if (response.payload === "") {
  20. dispatch({
  21. type: SHOW_PROGRESS_BAR,
  22. data: false
  23. })
  24. clearTimeout(timeout);
  25. }
  26. } else {
  27. clearTimeout(timeout);
  28. dispatch({
  29. type: SHOW_PROGRESS_BAR,
  30. data: false
  31. });
  32. }
  33. }
  34. }
  35.  
  36. Uncaught (in promise) TypeError: dispatch is not a function
  37. at _callee3$ (index.js:100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement