Skip to content

Commit

Permalink
feat(find): support type guards without casting
Browse files Browse the repository at this point in the history
  • Loading branch information
rob3c committed Nov 7, 2016
1 parent 68b7922 commit 9058bf6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/operator/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ import { Subscriber } from '../Subscriber';
* @owner Observable
*/
/* tslint:disable:max-line-length */
export function find<T>(this: Observable<T>, predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
export function find<T, S extends T>(this: Observable<T>, predicate: (value: T, index: number, source: Observable<T>) => value is S, thisArg?: any): Observable<S>;
export function find<T, S extends T>(this: Observable<T>,
predicate: ((value: T, index: number, source: Observable<T>) => boolean) |
((value: T, index: number, source: Observable<T>) => value is S),
thisArg?: any): Observable<S>;
/* tslint:disable:max-line-length */
export function find<T>(this: Observable<T>, predicate: (value: T, index: number, source: Observable<T>) => boolean,
thisArg?: any): Observable<T> {
Expand Down

0 comments on commit 9058bf6

Please sign in to comment.