While there are many cases where we often believe that an RxJS Subject is necessary, there is a way of avoiding them. In this lesson we will see how to identify the underlying source of data and convert it into an Observable, essentially eliminating the use of an error-prone Subject.
Or:
const count$ = Observable
.merge(click$, res$)
.mapTo(1)
.scan();