It's ironic that the author's recommendation of using `shareReplay(1)` actually leaks a subscription as well. Unless the operator is a supplied with `{ refCount: true }` config parameter, it does not unsubscribe from the source observable, even when all its subscribers unsubscribe: https://github.com/ReactiveX/rxjs/blob/master/src/internal/o...
Sadly, issues like this seem to crop up all the time when using reactive programming. I'm not as anti-reactive as most other commenters here seem to be, but there's no doubt that certain areas, particularly memory safety, sharing and buffering, seem hard to understand and get right.