Skip to content

Commit

Permalink
fix(Subscriber): creates subscriber throwable by default
Browse files Browse the repository at this point in the history
- closes #2813
  • Loading branch information
kwonoj committed Sep 25, 2017
1 parent 2e576dc commit 9309bae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Subscriber<T> extends Subscription implements Observer<T> {

public syncErrorValue: any = null;
public syncErrorThrown: boolean = false;
public syncErrorThrowable: boolean = false;
public syncErrorThrowable: boolean = true;

protected isStopped: boolean = false;
protected destination: PartialObserver<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)
Expand All @@ -60,24 +60,24 @@ export class Subscriber<T> extends Subscription implements Observer<T> {
switch (arguments.length) {
case 0:
this.destination = emptyObserver;
this.syncErrorThrowable = false;
break;
case 1:
if (!destinationOrNext) {
this.destination = emptyObserver;
this.syncErrorThrowable = false;
break;
}
if (typeof destinationOrNext === 'object') {
if (destinationOrNext instanceof Subscriber) {
this.destination = (<Subscriber<any>> destinationOrNext);
(<any> this.destination).add(this);
} else {
this.syncErrorThrowable = true;
this.destination = new SafeSubscriber<T>(this, <PartialObserver<any>> destinationOrNext);
}
break;
}
default:
this.syncErrorThrowable = true;
this.destination = new SafeSubscriber<T>(this, <((value: T) => void)> destinationOrNext, error, complete);
break;
}
Expand Down

0 comments on commit 9309bae

Please sign in to comment.