Skip to content

Commit b952718

Browse files
feat(find): Observable<T>.find() can take type guard as the predicate function
1 parent d62fbf0 commit b952718

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/operator/find.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export function find<T>(predicate: (value: T, index: number, source: Observable<
4545

4646
export interface FindSignature<T> {
4747
(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
48+
<S extends T>(predicate: (value: T, index: number, source: Observable<T>) => value is S, thisArg?: any): Observable<S>;
4849
}
4950

5051
export class FindValueOperator<T> implements Operator<T, T> {

0 commit comments

Comments
 (0)