Avoid memory leaks by unsubscribing in Angular
Using takeWhile rxjs operators in rxjs / Angular like it should be, to avoiding memory leaks.
Using the same boolean in the component for both the BehaviorSubject as well as HttpClient obvervables.
Defining my BehaviorSubject is done like this (in another service):
private setPageSource = new BehaviorSubject<PageEventData>(new PageEventData())
// Observable
setPage$ = this.setPageSource.asObservable()
Please register or sign in to comment