From e855af499c981e7f6e67f306eb2b2da2e5f3d18f Mon Sep 17 00:00:00 2001 From: pmoleri Date: Tue, 11 Nov 2025 10:56:50 -0300 Subject: [PATCH] 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. --- packages/rxjs/src/internal/operators/distinctUntilChanged.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rxjs/src/internal/operators/distinctUntilChanged.ts b/packages/rxjs/src/internal/operators/distinctUntilChanged.ts index 7cebddec78..1e31061e7f 100644 --- a/packages/rxjs/src/internal/operators/distinctUntilChanged.ts +++ b/packages/rxjs/src/internal/operators/distinctUntilChanged.ts @@ -4,7 +4,7 @@ import { Observable, operate } from '@rxjs/observable'; export function distinctUntilChanged(comparator?: (previous: T, current: T) => boolean): MonoTypeOperatorFunction; export function distinctUntilChanged( - comparator: (previous: K, current: K) => boolean, + comparator: ((previous: K, current: K) => boolean) | null | undefined, keySelector: (value: T) => K ): MonoTypeOperatorFunction; @@ -136,7 +136,7 @@ export function distinctUntilChanged( * source Observable with distinct values. */ export function distinctUntilChanged( - comparator?: (previous: K, current: K) => boolean, + comparator: ((previous: K, current: K) => boolean) | null | undefined, keySelector: (value: T) => K = identity as (value: T) => K ): MonoTypeOperatorFunction { // We've been allowing `null` do be passed as the `compare`, so we can't do