add The searchTerms RxJS subject

This commit is contained in:
Костя 2025-06-25 10:45:49 +03:00
parent ef2309f0f1
commit f6d361eb84
2 changed files with 10 additions and 2 deletions

View File

@ -37,4 +37,12 @@ export class HeroSearchComponent implements OnInit {
switchMap((term: string) => this.heroService.searchHeroes(term)),
);
}
private searchTerms = new Subject<string>();
// Push a search term into the observable stream.
search(term: string): void {
this.searchTerms.next(term);
}
}