Skip to content

Commit

Permalink
fix(throttleTime): throttle before next
Browse files Browse the repository at this point in the history
It was pointed out that the timings could be influenced due to slow user code, this has now been
solved.
  • Loading branch information
MatthiasKunnen committed Jul 24, 2019
1 parent bd2d6b1 commit 1a3fe43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/internal/operators/throttleTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ class ThrottleTimeSubscriber<T> extends Subscriber<T> {
this.throttled = null;

if (this.trailing && this._hasTrailingValue) {
this.destination.next(this._trailingValue);
this._trailingValue = null;
this._hasTrailingValue = false;

if (this.leading && this.trailing) {
this.throttle();
}

this.destination.next(this._trailingValue);
this._trailingValue = null;
this._hasTrailingValue = false;
}
}
}
Expand Down

0 comments on commit 1a3fe43

Please sign in to comment.