Hello, may I ask why you’re unsubscribing explicity in ngOnDestroy instead of using the async pipe?
Osama Sayed
11

Ah, it’s just an old habit, in this case. Started writing Angular 2 code before the async pipe was even a thing.

Having said that, in some of the other apps I’ve written, usually there is some amount pre-processing before I could actually use the object on the template. For example, there might be a need to combine streams of data from multiple reducers, or if the component class needs the object for any other reason.

In cases like the one in this chapter, you might be better of simply using the async pipe as it’ll take care of unsubscribing and disposing of the observable for you.