>

CODEMASTERYLAB

IDE PLATFORM
CoursesCommunity BlogsKnowledge GraphQuizzesInterview Prep

Sign in to track progress & earn XP

Sign In Create Account
>
Code Mastery Lab

Code Mastery Lab

Sign In

RxJS Observables — Thinking in Streams

Question 1 / 1

0:00
Core
Medium

A search box uses valueChanges.pipe(debounceTime(300), switchMap(term => this.api.search(term))). The user types 'ca', waits 400ms (triggering a search), then immediately types 'cat' before the 'ca' response arrives. What happens to the in-flight 'ca' request?

typescript this.results$ = this.searchControl.valueChanges.pipe( debounceTime(300), switchMap(term => this.apiService.search(term)) );