From 5788df29aaafb4608874ba708dd56b444dc1b328 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Wed, 27 Feb 2019 15:09:56 -0800 Subject: [PATCH] Revert "Use set and clear debouncer upon completion. Fixes #5250" This reverts commit e8d2314476a3ddcd804ca5afe5881f6f717736d2. --- lib/utils/debounce.html | 32 ---------------------------- lib/utils/flush.html | 30 ++++++++++++++++++++++++-- test/unit/debounce.html | 47 ----------------------------------------- 3 files changed, 28 insertions(+), 81 deletions(-) diff --git a/lib/utils/debounce.html b/lib/utils/debounce.html index 48efe629a5..1507faa20a 100644 --- a/lib/utils/debounce.html +++ b/lib/utils/debounce.html @@ -40,7 +40,6 @@ this._timer = this._asyncModule.run(() => { this._timer = null; this._callback(); - debouncerQueue.delete(this); }); } /** @@ -116,36 +115,5 @@ /** @const */ Polymer.Debouncer = Debouncer; - - let debouncerQueue = new Set(); - - /** - * Adds a `Debouncer` to a list of globally flushable tasks. - * - * @param {!Debouncer} debouncer Debouncer to enqueue - * @return {void} - */ - Polymer.enqueueDebouncer = function(debouncer) { - if (debouncerQueue.has(debouncer)) { - debouncerQueue.delete(debouncer); - } - debouncerQueue.add(debouncer); - }; - - Polymer.flushDebouncers = function() { - const didFlush = Boolean(debouncerQueue.size); - debouncerQueue.forEach(debouncer => { - try { - debouncer.flush(); - } catch(e) { - setTimeout(() => { - throw e; - }); - } - }); - debouncerQueue = new Set(); - return didFlush; - }; - })(); diff --git a/lib/utils/flush.html b/lib/utils/flush.html index 0ab98780cd..3feaad6166 100644 --- a/lib/utils/flush.html +++ b/lib/utils/flush.html @@ -8,11 +8,37 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> -