mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Adding ESLint
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./../utils');
|
||||
|
||||
function InterceptorManager() {
|
||||
'use strict';
|
||||
this.handlers = [];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new interceptor to the stack
|
||||
@@ -15,6 +14,7 @@ function InterceptorManager() {
|
||||
* @return {Number} An ID used to remove interceptor later
|
||||
*/
|
||||
InterceptorManager.prototype.use = function (fulfilled, rejected) {
|
||||
'use strict';
|
||||
this.handlers.push({
|
||||
fulfilled: fulfilled,
|
||||
rejected: rejected
|
||||
@@ -28,6 +28,7 @@ InterceptorManager.prototype.use = function (fulfilled, rejected) {
|
||||
* @param {Number} id The ID that was returned by `use`
|
||||
*/
|
||||
InterceptorManager.prototype.eject = function (id) {
|
||||
'use strict';
|
||||
if (this.handlers[id]) {
|
||||
this.handlers[id] = null;
|
||||
}
|
||||
@@ -42,12 +43,12 @@ InterceptorManager.prototype.eject = function (id) {
|
||||
* @param {Function} fn The function to call for each interceptor
|
||||
*/
|
||||
InterceptorManager.prototype.forEach = function (fn) {
|
||||
'use strict';
|
||||
utils.forEach(this.handlers, function (h) {
|
||||
if (h !== null) {
|
||||
fn(h);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = InterceptorManager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user