From 0cbbbaead06b4fa845ab35605250ab563273bd3e Mon Sep 17 00:00:00 2001 From: Matthias Kunnen Date: Wed, 13 Feb 2019 21:53:33 +0100 Subject: [PATCH] fix(throttleTime): fix single value with leading disabled, trailing enabled Emit single value with leading disabled, trailing enabled. Closes #2859 and #4491. --- src/internal/operators/throttleTime.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/internal/operators/throttleTime.ts b/src/internal/operators/throttleTime.ts index b5da87585c..5da1540c79 100644 --- a/src/internal/operators/throttleTime.ts +++ b/src/internal/operators/throttleTime.ts @@ -101,6 +101,9 @@ class ThrottleTimeSubscriber extends Subscriber { this.add(this.throttled = this.scheduler.schedule>(dispatchNext, this.duration, { subscriber: this })); if (this.leading) { this.destination.next(value); + } else if (this.trailing) { + this._trailingValue = value; + this._hasTrailingValue = true; } } }