Created
June 14, 2018 20:50
-
-
Save AmirTugi/de5e5243fae03355617159578ef73836 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.usersForm = this.fb.group({ | |
userInput: null | |
}) | |
this.usersForm | |
.get('userInput') | |
.valueChanges | |
.pipe( | |
debounceTime(300), | |
tap(() => this.isLoading = true), | |
switchMap(value => this.appService.search({name: value}, 1) | |
.pipe( | |
finalize(() => this.isLoading = false), | |
) | |
) | |
) | |
.subscribe(users => this.filteredUsers = users.results); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment