Skip to content

Commit

Permalink
Decrement requests in the next tick
Browse files Browse the repository at this point in the history
  • Loading branch information
cibernox committed Apr 19, 2018
1 parent 470dddb commit 3235478
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/ember-testing/lib/test/pending_requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ export function incrementPendingRequests(_, xhr) {
}

export function decrementPendingRequests(_, xhr) {
for (let i = 0; i < requests.length; i++) {
if (xhr === requests[i]) {
requests.splice(i, 1);
break;
setTimeout(function() {
for (let i = 0; i < requests.length; i++) {
if (xhr === requests[i]) {
requests.splice(i, 1);
break;
}
}
}
}, 0);
}

0 comments on commit 3235478

Please sign in to comment.