From 3a926b939e4d8fee9457af3d0e7a992ea26e2462 Mon Sep 17 00:00:00 2001 From: John Cheevers Date: Fri, 10 Feb 2017 11:13:40 -0600 Subject: [PATCH] fix(throttle): ChildSubscriptions removed on inner unsubscribe (#2355) Hold reference to ChildSubscription, not Subscription, so it can be properly removed later. --- src/operator/throttle.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/operator/throttle.ts b/src/operator/throttle.ts index fc352ad71b..1993a356b5 100644 --- a/src/operator/throttle.ts +++ b/src/operator/throttle.ts @@ -89,14 +89,13 @@ class ThrottleSubscriber extends OuterSubscriber { } private emitAndThrottle(value: T, duration: SubscribableOrPromise) { - this.add(this.throttled = subscribeToResult(this, duration)); + this.throttled = this.add(subscribeToResult(this, duration)); this.destination.next(value); } protected _unsubscribe() { const throttled = this.throttled; if (throttled) { - this.remove(throttled); this.throttled = null; throttled.unsubscribe(); }