@@ -4,7 +4,8 @@ import { Observable } from '../Observable';
44import { OperatorFunction , MonoTypeOperatorFunction , TeardownLogic } from '../types' ;
55
66/* tslint:disable:max-line-length */
7- export function filter < T > ( predicate : BooleanConstructor ) : OperatorFunction < T , NonNullable < T > > ;
7+ // NOTE(benlesh): T|null|undefined solves the issue discussed here: https://github.com/ReactiveX/rxjs/issues/4959#issuecomment-520629091
8+ export function filter < T > ( predicate : BooleanConstructor ) : OperatorFunction < T | null | undefined , NonNullable < T > > ;
89export function filter < T , S extends T > ( predicate : ( value : T , index : number ) => value is S ,
910 thisArg ?: any ) : OperatorFunction < T , S > ;
1011export function filter < T > ( predicate : ( value : T , index : number ) => boolean ,
@@ -43,18 +44,14 @@ export function filter<T>(predicate: (value: T, index: number) => boolean,
4344 * @see {@link partition }
4445 * @see {@link skip }
4546 *
46- * @param { function(value: T, index: number): boolean } predicate A function that
47+ * @param predicate A function that
4748 * evaluates each value emitted by the source Observable. If it returns `true`,
4849 * the value is emitted, if `false` the value is not passed to the output
4950 * Observable. The `index` parameter is the number `i` for the i-th source
5051 * emission that has happened since the subscription, starting from the number
5152 * `0`.
52- * @param { any } [ thisArg] An optional argument to determine the value of `this`
53+ * @param thisArg An optional argument to determine the value of `this`
5354 * in the `predicate` function.
54- * @return {Observable } An Observable of values from the source that were
55- * allowed by the `predicate` function.
56- * @method filter
57- * @owner Observable
5855 */
5956export function filter < T > ( predicate : ( value : T , index : number ) => boolean ,
6057 thisArg ?: any ) : MonoTypeOperatorFunction < T > {
0 commit comments