Skip to content

Instantly share code, notes, and snippets.

@ardydedase
Created September 25, 2021 17:01
Show Gist options
  • Select an option

  • Save ardydedase/9f14f6d1b591be69475ebd92e2e0e73b to your computer and use it in GitHub Desktop.

Select an option

Save ardydedase/9f14f6d1b591be69475ebd92e2e0e73b to your computer and use it in GitHub Desktop.
ngOnInit() {
// this.results$ = this.searchSubject$.pipe...
this.searchReposSub = this.searchReposFormControl.valueChanges.subscribe(
(searchString) => {
if (searchString) {
this.searchType = SearchType.REPOS;
this.searchSubject$.next(searchString);
}
}
);
this.searchUsersSub = 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