-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inner subscription teardown with multiple instances of Rx #3443
Comments
Rx core internally rely on some object checks like instanceof, having multiple installation of Rx and interopping between 2 Observable is not supported (will have various unexpected side effect). We may improve error handling better in further, but any cases it's not supported and need to ensure application only have single imports of Rx. |
Thanks for responding @kwonoj, will this situation change at all when 6.0.0 is released? |
not at this moment. if it happens, directly will be probably raise a warning for multiple instances. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
RxJS version: 5.5.7
Code to reproduce:
https://github.com/kobelb/rxjs-multiple/blob/master/index.js
Expected behavior:
The teardown/unsubscription logic in the inner subscription should be called
Actual behavior:
The teardown logic isn't called
Additional information:
There's some interesting behavior with inner subscriptions teardown logic when using different "instances" of RxJs, even if they're the same version. I ran into a situation when working on a plugin for Kibana where the main Kibana project is exposing an interface based on Observables for the plugins to consume, but the teardown logic for the inner subscriptions wasn't being called. I've managed to trace the culprit down to the Kibana project and the plugin importing RxJs from each of their respective
node_modules
, even though they're the same version they're different "instances".Interestingly, if I remove the
.map(i => i)
from the inner subscription everything works correctly.The text was updated successfully, but these errors were encountered: