Skip to content

Commit

Permalink
Add comment about flush order when re-debouncing
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Feb 28, 2019
1 parent 1e56b0e commit b63c887
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/utils/debounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export class Debouncer {
if (this.isActive()) {
this._cancelAsync();
this._timer = null;
// Canceling a debouncer removes its spot from the flush queue,
// so if a debouncer is manually canceled and re-debounced, it
// will reset its flush order (this is a very minor difference from 1.x)
// Re-debouncing via the `debounce` API retains the 1.x FIFO flush order
debouncerQueue.delete(this);
}
}
Expand Down

0 comments on commit b63c887

Please sign in to comment.