SocketCluster / socketcluster-client

JavaScript client for SocketCluster
MIT License
292 stars 91 forks source link

Add 'subscribeRequest' event to client #25

Closed mattkrick closed 8 years ago

mattkrick commented 8 years ago

Currently, the subscribe method internally adds the sub & its pending state to a queue, but it doesn't emit anything, so nothing else in the app knows we're trying to subscribe. This would be useful for showing a loading UI on recently mounted components.

I propose emitting a subscribeRequest event at the bottom of SCSocket.prototype.subscribe. Will be happy to submit a PR & update docs.

jondubois commented 8 years ago

@mattkrick Yes that sounds like a good addition. PR welcome.