Bones/node_modules/rxjs/operator/first.d.ts

9 lines
606 B
TypeScript
Raw Normal View History

2017-05-17 13:45:25 -04:00
import { Observable } from '../Observable';
/**
* Returns an Observable that emits the first item of the source Observable that matches the specified condition.
* Throws an error if matching element is not found.
* @param {function} predicate function called with each item to test for condition matching.
* @returns {Observable} an Observable of the first item that matches the condition.
*/
export declare function first<T, R>(predicate?: (value: T, index: number, source: Observable<T>) => boolean, resultSelector?: (value: T, index: number) => R, defaultValue?: R): Observable<T> | Observable<R>;