Gestion de la Subscription ⚠️
Unsubscribe dans ngOnDestroy
Unsubscribe dans ngOnDestroyprivate _bookListSubscription: Subscription;
constructor(private _bookRepository: BookRepository) {
}
ngOnInit() {
this._bookListSubscription = this._bookRepository.getBookList()
.subscribe(bookList => this.bookList = bookList);
}
ngOnDestroy() {
this._bookListSubscription.unsubscribe();
}Unsubscribe avec l'opérateur takeUntil
Unsubscribe avec l'opérateur takeUntilExemple
Unsubscribe avec le Pipe async
asyncA éviter
Fonctionnement du "pipe" async
asyncGotcha
shareReplay
shareReplayGestion d'erreurs
Exemple


RxScavenger
Mis à jour