Skip to content

Commit

Permalink
fix(debounce): clear emit timer interval on stop
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wclr committed May 28, 2020
1 parent f65f6b7 commit 719bcd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/extra/debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DebounceOperator<T> implements Operator<T, T> {
_stop(): void {
this.ins._remove(this);
this.out = null as any;
this.id = null;
this.clearInterval();
}

clearInterval() {
Expand Down

0 comments on commit 719bcd9

Please sign in to comment.