Quantcast
Channel: Can't make debounceTime() or throttleTime() to work on an Angular http request - Stack Overflow
Viewing all articles
Browse latest Browse all 102

Answer by Iglix Labs for Can't make debounceTime() or throttleTime() to work on an Angular http request

$
0
0

Using form control

<input type="text" [formControl]="term">

component

term = new FormControl();  ngOnInit() {    this.items = this.term.valueChanges                 .debounceTime(3000)                 .distinctUntilChanged()                 .switchMap(term => getCategoriesList(term))                 .subscribe(res => console.log(res));  }

Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>