Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Unhandled Rejection (TypeError): dispatch is not a function
- export function getStatus(requestId) {
- return async dispatch => {
- let url = GET_UPLOADED_STATUS_URL + requestId;
- let response = await get(url);
- const timeout = setTimeout(getStatus(requestId), 2000);
- if (response.status === 200) {
- let total = response.payload.count;
- let totalCompleted = response.payload.uploadCompleted
- dispatch({
- type: UPDATE_PROGRESS_BAR_STATUS,
- total: total,
- completed: totalCompleted
- })
- if (!response.payload == "") {
- toastr.info(`Total processed ${totalCompleted}`);
- }
- if (response.payload === "") {
- dispatch({
- type: SHOW_PROGRESS_BAR,
- data: false
- })
- clearTimeout(timeout);
- }
- } else {
- clearTimeout(timeout);
- dispatch({
- type: SHOW_PROGRESS_BAR,
- data: false
- });
- }
- }
- }
- Uncaught (in promise) TypeError: dispatch is not a function
- at _callee3$ (index.js:100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement