Closed jonathan-s closed 4 years ago
I’m pretty sure that this would actually be a change most appropriately made to the ActionCable JS library, not StimulusReflex. It seems like we could import a worker version of consumer.js.
As interesting as this is, it’s not something we’re likely to take on but we’d be very supportive if you do.
That's fair enough. I'll keep this issue as a reminder for myself. :)
Have you checked out the ActionCable repo? It’s highly possible that someone has built this, and we’d be thrilled.
Neat solution; though, it definitely belongs in ActionCable.
@jonathan-s As this isn't likely to be implemented within StimulusReflex, would you mind closing this issue?
closing this then. and you are both right that it would make more sense in actioncable.
Feature Request
I think that the current case is that if you opened up several tabs with the same stimulusreflex controller you would end up with multiple websocket connections, this is a bit wasteful. So at some point it might be worth exploring how this can be minimized.
A starting point might be to check out this -> https://blog.pusher.com/reduce-websocket-connections-with-shared-workers/