From 1a3fe43d149508187b4adc84be9588c75b134523 Mon Sep 17 00:00:00 2001 From: Matthias Kunnen Date: Wed, 24 Jul 2019 15:59:34 +0000 Subject: [PATCH] fix(throttleTime): throttle before next It was pointed out that the timings could be influenced due to slow user code, this has now been solved. --- src/internal/operators/throttleTime.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/internal/operators/throttleTime.ts b/src/internal/operators/throttleTime.ts index 7f23be8fe8..c00ce1f91d 100644 --- a/src/internal/operators/throttleTime.ts +++ b/src/internal/operators/throttleTime.ts @@ -158,13 +158,13 @@ class ThrottleTimeSubscriber extends Subscriber { 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; } } }