Skip to content

Commit

Permalink
fix(subscriptions): fixes bug that tracked subscriber subscriptions t…
Browse files Browse the repository at this point in the history
…wice.
  • Loading branch information
trxcllnt authored and benlesh committed May 12, 2016
1 parent d1412bc commit 29ff794
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/Observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ export class Observable<T> implements Subscribable<T> {
const { operator } = this;
const sink = toSubscriber(observerOrNext, error, complete);

sink.add(operator ? operator.call(sink, this) : this._subscribe(sink));
if (operator) {
operator.call(sink, this);
} else {
sink.add(this._subscribe(sink));
}

if (sink.syncErrorThrowable) {
sink.syncErrorThrowable = false;
Expand Down
4 changes: 1 addition & 3 deletions src/operator/groupBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ class GroupBySubscriber<T, K, R> extends Subscriber<T> implements RefCountSubscr
private keySelector: (value: T) => K,
private elementSelector?: (value: T) => R,
private durationSelector?: (grouped: GroupedObservable<K, R>) => Observable<any>) {
super();
this.destination = destination;
this.add(destination);
super(destination);
}

protected _next(value: T): void {
Expand Down

0 comments on commit 29ff794

Please sign in to comment.