Skip to content

Commit

Permalink
fix(toggle): ChildSubscriptions removed on inner unsubscribe (Reactiv…
Browse files Browse the repository at this point in the history
…eX#2355)

Hold reference to ChildSubscription, not Subscription, so it can be properly removed later.
  • Loading branch information
johncvrs committed Feb 10, 2017
1 parent 31dfc73 commit 9be59ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/operator/throttle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ class ThrottleSubscriber<T, R> extends OuterSubscriber<T, R> {
}

private emitAndThrottle(value: T, duration: SubscribableOrPromise<number>) {
this.add(this.throttled = subscribeToResult(this, duration));
// 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();
}
Expand Down

0 comments on commit 9be59ac

Please sign in to comment.