Be careful with shareReplay(1). It never unsubscribes in version 6. You need to specify refCount: true as a params to unsubscribe when there is no subscriber anymore. As you can see in the code, the refCount is false by default : github.com/ReactiveX/rxjs/blob/6.6...
To avoid this pitfall you can do shareReplay({ bufferSize: 1, refCount: true })
Note: I think that this is working as expected in version 7 though
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Be careful with
shareReplay(1)
. It never unsubscribes in version 6. You need to specifyrefCount: true
as a params to unsubscribe when there is no subscriber anymore. As you can see in the code, therefCount
isfalse
by default :github.com/ReactiveX/rxjs/blob/6.6...
To avoid this pitfall you can do
shareReplay({ bufferSize: 1, refCount: true })
Note: I think that this is working as expected in version 7 though