Skip to content

Instantly share code, notes, and snippets.

@ardydedase
Created September 25, 2021 17:54
Show Gist options
  • Save ardydedase/f5d57c5558456ade1b251b476ffc17b7 to your computer and use it in GitHub Desktop.
Save ardydedase/f5d57c5558456ade1b251b476ffc17b7 to your computer and use it in GitHub Desktop.
ngOnInit() {
// this.results$ =...
this.subscriptions.push(
this.searchReposFormControl.valueChanges.subscribe((searchString) => {
if (searchString) {
this.searchType = SearchType.REPOS;
this.searchSubject$.next(searchString);
}
}),
this.searchUsersFormControl.valueChanges.subscribe((searchString) => {
if (searchString) {
this.searchType = SearchType.USERS;
this.searchSubject$.next(searchString);
}
})
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment