From 719bcd9ec0333073f3eea12ba63fac768cdec60a Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 28 May 2020 19:53:43 +0500 Subject: [PATCH] fix(debounce): clear emit timer interval on stop PR #296 If not do this there is possible bug, when timer is set (not executed) and stream stopped if timer interval is not cleared it results in infinite emitting (not sure why emitting is looped). I don't have a clean simple repro example, but it happened in my app, had to debug it. Any way seems logical to clear not executed interval on stop, and not to clear is potential wrong. --- src/extra/debounce.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extra/debounce.ts b/src/extra/debounce.ts index 4e46ae2..e1a2a8a 100644 --- a/src/extra/debounce.ts +++ b/src/extra/debounce.ts @@ -18,7 +18,7 @@ class DebounceOperator implements Operator { _stop(): void { this.ins._remove(this); this.out = null as any; - this.id = null; + this.clearInterval(); } clearInterval() {