From 0e671f5f988882f7cffdf9841c918876cda5aa00 Mon Sep 17 00:00:00 2001 From: Jack Meagher Date: Mon, 12 Jun 2017 15:48:51 -0400 Subject: [PATCH] Add clarification to custom comparer example Several open pull requests seem to not have noticed that the custom comparer function here is inverted, and hence the output listed (42, 42) is correct. Hopefully this quick comment change will make it clear that this is not a mistake. --- doc/api/core/operators/distinctuntilchanged.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/core/operators/distinctuntilchanged.md b/doc/api/core/operators/distinctuntilchanged.md index 7b2e58c77..cc836ac06 100644 --- a/doc/api/core/operators/distinctuntilchanged.md +++ b/doc/api/core/operators/distinctuntilchanged.md @@ -50,7 +50,7 @@ var subscription = source.subscribe( // => Next: { value: 24 } // => Completed -/* With comparer */ +/* With custom comparer, which returns false when values ARE equal */ var source = Rx.Observable.of({value: 42}, {value: 42}, {value: 24}, {value: 24}) .distinctUntilChanged(function (x) { return x.value; }, function (a,b) { return a !== b; });