axios callback onUploadProgress code example
Example: when is onUploadProgressCalled axios
let response = await axios({
method: 'post',
url: imageUploadUrl,
data: {
connectorId,
data
},
onUploadProgress: (progressEvent) => {
const { loaded, total } = progressEvent;
dispatch(updateImageUploadProgress(loaded, total));
},
cancelToken: new CancelToken(token => {
cancelAxiosRequest = token;
})
});