Created
May 23, 2018 07:50
-
-
Save Supamiu/90655d9a756bf154ecd80dc23b5fb9cd 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
search(text$: Observable<string>) { | |
return text$.pipe( | |
debounceTime(500), | |
distinctUntilChanged(), | |
mergeMap((term) => { | |
// this.chatService.setPseudpInput(term); | |
return this.chatService.getUserByPseudo(term) | |
.pipe( | |
map(values => { | |
// states = values; | |
return term.length < 2 ? [] : states.filter(v => v); | |
}) | |
); | |
} | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment