Skip to content

Commit

Permalink
Clear timeout after aborting pending executions (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
edy authored and sindresorhus committed Feb 18, 2019
1 parent 82080a5 commit 98b8506
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const pThrottle = (fn, limit, interval) => {

throttled.abort = () => {
for (const timeout of queue.keys()) {
clearTimeout(timeout);
queue.get(timeout)(new AbortError());
}

Expand Down

0 comments on commit 98b8506

Please sign in to comment.