From 52513f22ec888379be65861087855983a511a994 Mon Sep 17 00:00:00 2001 From: Mohammed Sahl Date: Fri, 23 Feb 2024 12:02:03 +0400 Subject: [PATCH] Fix link --- operators/filtering/distinctuntilchanged.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operators/filtering/distinctuntilchanged.md b/operators/filtering/distinctuntilchanged.md index 5698eba..5251db7 100644 --- a/operators/filtering/distinctuntilchanged.md +++ b/operators/filtering/distinctuntilchanged.md @@ -18,7 +18,7 @@ match! This operator stands guard, ensuring that you're not bombarded with repetitive information. Imagine if your best friend kept repeating the same story to you every time you met. It'd get old, right? The `distinctUntilChanged` operator does just that; it prevents subsequent identical emissions from an observable. -Think about a search bar on a website. As users type their queries, you don't want to send a server request for the same input value multiple times in a row, it would be redundant and inefficient. Here’s where `distinctUntilChanged` combined with [`debounceTime`](debouncetime.md) could shine. Imagine a user typing in a search term and then slightly hesitating before adding another letter. You might want to wait just a little bit (that’s (`debounceTime`)[debouncetime.md] doing its magic) and then, before firing off a request, ensure the term is actually different than the previous one - this is where you can utilize `distinctUntilChanged`. +Think about a search bar on a website. As users type their queries, you don't want to send a server request for the same input value multiple times in a row, it would be redundant and inefficient. Here’s where `distinctUntilChanged` combined with [`debounceTime`](debouncetime.md) could shine. Imagine a user typing in a search term and then slightly hesitating before adding another letter. You might want to wait just a little bit (that’s [`debounceTime`](debouncetime.md) doing its magic) and then, before firing off a request, ensure the term is actually different than the previous one - this is where you can utilize `distinctUntilChanged`. For example, if a user is searching for "apple" and they type "app" -> wait a bit -> "appl" -> backtrack to "app" -> type again "appl", without `distinctUntilChanged`, you might end up sending redundant requests. But with it, once "appl" is recognized as previously processed, it won't send the redundant search request again.