Skip to content

Commit e855af4

Browse files
authored
Allow null | undefined as distinctUntilChanged parameter
Both the documentation and the code allow for undefined parameter (and null), but in the exported types didn't allow it.
1 parent c15b37f commit e855af4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/rxjs/src/internal/operators/distinctUntilChanged.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Observable, operate } from '@rxjs/observable';
44

55
export function distinctUntilChanged<T>(comparator?: (previous: T, current: T) => boolean): MonoTypeOperatorFunction<T>;
66
export function distinctUntilChanged<T, K>(
7-
comparator: (previous: K, current: K) => boolean,
7+
comparator: ((previous: K, current: K) => boolean) | null | undefined,
88
keySelector: (value: T) => K
99
): MonoTypeOperatorFunction<T>;
1010

@@ -136,7 +136,7 @@ export function distinctUntilChanged<T, K>(
136136
* source Observable with distinct values.
137137
*/
138138
export function distinctUntilChanged<T, K>(
139-
comparator?: (previous: K, current: K) => boolean,
139+
comparator: ((previous: K, current: K) => boolean) | null | undefined,
140140
keySelector: (value: T) => K = identity as (value: T) => K
141141
): MonoTypeOperatorFunction<T> {
142142
// We've been allowing `null` do be passed as the `compare`, so we can't do

0 commit comments

Comments
 (0)