Code coverage report for src/InnerSubscriber.ts

Statements: 100% (19 / 19)      Branches: 100% (0 / 0)      Functions: 100% (5 / 5)      Lines: 100% (14 / 14)      Ignored: none     

All files » src/ » InnerSubscriber.ts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251     1 2445   2445 2445     1 3545     1 209 209     1 1524 1524   1  
import {Subscriber} from './Subscriber';
import {OuterSubscriber} from './OuterSubscriber';
 
export class InnerSubscriber<T, R> extends Subscriber<R> {
  private index: number = 0;
 
  constructor(private parent: OuterSubscriber<T, R>, private outerValue: T, private outerIndex: number) {
    super();
  }
 
  protected _next(value: R) {
    this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++);
  }
 
  protected _error(error: any) {
    this.parent.notifyError(error, this);
    this.unsubscribe();
  }
 
  protected _complete() {
    this.parent.notifyComplete(this);
    this.unsubscribe();
  }
}