Question 1 / 1
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)) );