attach callback to onUploadProgress axios in react 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;
})
});