minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / src / internal / InnerSubscriber.ts
1 import { Subscriber } from './Subscriber';
2 import { OuterSubscriber } from './OuterSubscriber';
3
4 /**
5  * We need this JSDoc comment for affecting ESDoc.
6  * @ignore
7  * @extends {Ignored}
8  */
9 export class InnerSubscriber<T, R> extends Subscriber<R> {
10   private index = 0;
11
12   constructor(private parent: OuterSubscriber<T, R>, public outerValue: T, public outerIndex: number) {
13     super();
14   }
15
16   protected _next(value: R): void {
17     this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
18   }
19
20   protected _error(error: any): void {
21     this.parent.notifyError(error, this);
22     this.unsubscribe();
23   }
24
25   protected _complete(): void {
26     this.parent.notifyComplete(this);
27     this.unsubscribe();
28   }
29 }