Skip to content

Instantly share code, notes, and snippets.

@Supamiu
Created May 23, 2018 07:50
Show Gist options
  • Save Supamiu/90655d9a756bf154ecd80dc23b5fb9cd to your computer and use it in GitHub Desktop.
Save Supamiu/90655d9a756bf154ecd80dc23b5fb9cd to your computer and use it in GitHub Desktop.
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