You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rxjs-spy is not handling connectable observables correctly. This will impact the multicast family of operators, including share.
When a shared observable is completely unsubscribed, then resubscribed later, normally the source observable is resubscribed.
When there is a spy object created, this is not working. The share operator creates an internal subject, I see that is not being unsubscribed as well.
Here is some code that demonstrates the issue. The issue is present if a spy object has been created.
const shared$ = interval(100).pipe(
share()
);
const a = shared.subscribe(() => log('a'))
setTimeout(() => a.unsubscribe(), 200); // a logged twice, then the interval() observable is unsubscribed
setTimeout(() => shared.subscribe(() => log('b')), 1000); //Nothing logged. This should log b repeatedly
Rxjs-spy is not handling connectable observables correctly. This will impact the multicast family of operators, including share.
When a shared observable is completely unsubscribed, then resubscribed later, normally the source observable is resubscribed.
When there is a spy object created, this is not working. The share operator creates an internal subject, I see that is not being unsubscribed as well.
Here is some code that demonstrates the issue. The issue is present if a spy object has been created.
Here is a runnable version
https://stackblitz.com/edit/rxjs-spy-share?file=index.ts
The text was updated successfully, but these errors were encountered: