Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //RxJs Subscriber class constructor
- constructor(destinationOrNext?: PartialObserver<any> | ((value: T) => void), error?: (e?: any) => void,complete?: () => void) {
- super();
- switch (arguments.length) {
- case 0:
- this.destination = emptyObserver;
- break;
- case 1:
- if (!destinationOrNext) {
- this.destination = emptyObserver;
- break;
- }
- if (typeof destinationOrNext === 'object') {
- if (destinationOrNext instanceof Subscriber) {
- this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
- this.destination = destinationOrNext;
- destinationOrNext.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;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement