1const config = {
2 onUploadProgress: progressEvent => console.log(progressEvent.loaded)
3}
1let response = await axios({
2 method: 'post',
3 url: imageUploadUrl,
4 data: {
5 connectorId,
6 data
7 },
8 onUploadProgress: (progressEvent) => {
9 const { loaded, total } = progressEvent;
10 dispatch(updateImageUploadProgress(loaded, total));
11 },
12 cancelToken: new CancelToken(token => {
13 cancelAxiosRequest = token;
14 })
15});
16