2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

Adding ESLint

This commit is contained in:
mzabriskie
2015-03-17 14:14:26 -06:00
parent 7387829d33
commit a98c61f458
17 changed files with 128 additions and 77 deletions
+6 -5
View File
@@ -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;