Angular · Middle · Question 17 of 75

Why add distinctUntilChanged() after debounceTime(300) in a search box?

Explanation

Typing "ab", deleting "b" and typing it again within the debounce window produces "ab" again. distinctUntilChanged drops that duplicate before switchMap sends a request.

Further reading

Problem with a question

Angular · Middle · question 17

Test yourself

Take the Angular · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz