Code coverage report for src/operator/findIndex.ts

Statements: 100% (4 / 4)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

All files » src/operator/ » findIndex.ts
1 2 3 4 5 6 7 8 9 10 11 12 13  1               1 11    
import {Observable} from '../Observable';
import {FindValueOperator} from './find';
 
/**
 * Returns an Observable that searches for the first item in the source Observable that
 * matches the specified condition, and returns the the index of the item in the source.
 * @param {function} predicate function called with each item to test for condition matching.
 * @returns {Observable} an Observable of the index of the first item that matches the condition.
 */
export function findIndex<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<number> {
  return this.lift(new FindValueOperator(predicate, this, true, thisArg));
}