Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Feb 27, 2019
1 parent 8fba53f commit f4df466
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/utils/debounce.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@
* @return {void}
*/
Polymer.enqueueDebouncer = function(debouncer) {
// Re-enqueued debouncers are put at the end of the queue; for Set, this
// means removing and re-adding, since forEach traverses insertion order
if (debouncerQueue.has(debouncer)) {
debouncerQueue.delete(debouncer);
}
Expand All @@ -135,6 +137,8 @@

Polymer.flushDebouncers = function() {
const didFlush = Boolean(debouncerQueue.size);
// If new debouncers are added while flushing, Set.forEach will ensure
// newly added ones are also flushed
debouncerQueue.forEach(debouncer => {
try {
debouncer.flush();
Expand Down

0 comments on commit f4df466

Please sign in to comment.