@@ -4,7 +4,8 @@ import { Observable } from '../Observable';
4
4
import { OperatorFunction , MonoTypeOperatorFunction , TeardownLogic } from '../types' ;
5
5
6
6
/* 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 > > ;
8
9
export function filter < T , S extends T > ( predicate : ( value : T , index : number ) => value is S ,
9
10
thisArg ?: any ) : OperatorFunction < T , S > ;
10
11
export function filter < T > ( predicate : ( value : T , index : number ) => boolean ,
@@ -43,18 +44,14 @@ export function filter<T>(predicate: (value: T, index: number) => boolean,
43
44
* @see {@link partition }
44
45
* @see {@link skip }
45
46
*
46
- * @param { function(value: T, index: number): boolean } predicate A function that
47
+ * @param predicate A function that
47
48
* evaluates each value emitted by the source Observable. If it returns `true`,
48
49
* the value is emitted, if `false` the value is not passed to the output
49
50
* Observable. The `index` parameter is the number `i` for the i-th source
50
51
* emission that has happened since the subscription, starting from the number
51
52
* `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`
53
54
* 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
58
55
*/
59
56
export function filter < T > ( predicate : ( value : T , index : number ) => boolean ,
60
57
thisArg ?: any ) : MonoTypeOperatorFunction < T > {
0 commit comments