Skip to content

Commit

Permalink
Merge pull request #38 from usernane/dev
Browse files Browse the repository at this point in the history
Added Support for `hasActiveRequest`
  • Loading branch information
usernane authored Jan 22, 2023
2 parents 590aab2 + 9b90401 commit ee726f7
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions AJAXRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ Object.defineProperties(AJAXRequest, {

Object.defineProperties(AJAXRequest.META, {
VERSION: {
value: '2.1.2',
value: '2.1.3',
writable: false
},
REALSE_DATE: {
value: '2022-09-14',
value: '2023-01-22',
writable: false
},
CONTRIBUTORS: {
Expand Down Expand Up @@ -327,7 +327,7 @@ function AJAXRequest(config = {
this.retry.id = setInterval(function () {

i.retry.passed++;
i.retry.func(i.retry.wait - i.retry.passed);
i.retry.func(i.retry.wait - i.retry.passed, i.retry.pass_number);
if (i.retry.passed === i.retry.wait) {
clearInterval(i.retry.id);
i.retry.passed = 0;
Expand Down Expand Up @@ -1671,6 +1671,18 @@ function AJAXRequest(config = {
},
writable:false,
enumerable: true
},
hasActiveRequest:{
value:function () {
for (var x = 0 ; x < this.xhr_pool.length ; x++) {
if (this.xhr_pool[x].active) {
return true;
}
}
return false;
},
writable:false,
enumerable: true
}
});

Expand Down

0 comments on commit ee726f7

Please sign in to comment.