Reusing Observables with named Observables? #6589
abarke
started this conversation in
Ideas / Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a use case where we use a WebSocketSubject to connect to our backend where we can send JSON-RPC style messages to subscribe to various data sources using Multiplex. The problem is that we have many web components that require the same data.
The goal is to be able to reuse existing subscriptions between web components instead of subscribing twice to the same data source.
One way to solve this is by creating a Map that keeps track of all the registered observables created using Multiplex and give them a unique ID where
Ideally it would be nice to have RxJS keep track of all observables and allow developers to dig one out should it exist e.g.
Does this make sense? overkill? or a better way of reusing subscriptions/observables/subjects?
Beta Was this translation helpful? Give feedback.
All reactions