axios-retry
Advanced tools
Comparing version 3.5.1 to 3.6.0
@@ -228,2 +228,4 @@ "use strict"; | ||
* A function to get notified when a retry occurs | ||
* @return {{ requestInterceptorId: number, responseInterceptorId: number }} | ||
* The ids of the interceptors added to the request and to the response (so they can be ejected at a later time) | ||
*/ | ||
@@ -273,3 +275,3 @@ | ||
function axiosRetry(axios, defaultOptions) { | ||
axios.interceptors.request.use(function (config) { | ||
var requestInterceptorId = axios.interceptors.request.use(function (config) { | ||
var currentState = getCurrentState(config); | ||
@@ -279,3 +281,3 @@ currentState.lastRequestTime = Date.now(); | ||
}); | ||
axios.interceptors.response.use(null, /*#__PURE__*/function () { | ||
var responseInterceptorId = axios.interceptors.response.use(null, /*#__PURE__*/function () { | ||
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(error) { | ||
@@ -359,2 +361,6 @@ var config, _getRequestOptions, _getRequestOptions$re, retries, _getRequestOptions$re2, retryCondition, _getRequestOptions$re3, retryDelay, _getRequestOptions$sh, shouldResetTimeout, _getRequestOptions$on, onRetry, currentState, delay, lastRequestDuration, timeout; | ||
}()); | ||
return { | ||
requestInterceptorId: requestInterceptorId, | ||
responseInterceptorId: responseInterceptorId | ||
}; | ||
} // Compatibility with CommonJS | ||
@@ -361,0 +367,0 @@ |
@@ -201,2 +201,4 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||
* A function to get notified when a retry occurs | ||
* @return {{ requestInterceptorId: number, responseInterceptorId: number }} | ||
* The ids of the interceptors added to the request and to the response (so they can be ejected at a later time) | ||
*/ | ||
@@ -225,3 +227,3 @@ | ||
export default function axiosRetry(axios, defaultOptions) { | ||
axios.interceptors.request.use(config => { | ||
var requestInterceptorId = axios.interceptors.request.use(config => { | ||
var currentState = getCurrentState(config); | ||
@@ -231,3 +233,3 @@ currentState.lastRequestTime = Date.now(); | ||
}); | ||
axios.interceptors.response.use(null, /*#__PURE__*/function () { | ||
var responseInterceptorId = axios.interceptors.response.use(null, /*#__PURE__*/function () { | ||
var _ref = _asyncToGenerator(function* (error) { | ||
@@ -281,2 +283,6 @@ var { | ||
}()); | ||
return { | ||
requestInterceptorId, | ||
responseInterceptorId | ||
}; | ||
} // Compatibility with CommonJS | ||
@@ -283,0 +289,0 @@ |
{ | ||
"name": "axios-retry", | ||
"version": "3.5.1", | ||
"version": "3.6.0", | ||
"author": "Rubén Norte <ruben.norte@softonic.com>", | ||
@@ -5,0 +5,0 @@ "description": "Axios plugin that intercepts failed requests and retries them whenever posible.", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70230
865