davinkevin / AngularStompDK

Angular service to communicate to Stomp-Websocket
http://davinkevin.github.io/AngularStompDK/
Apache License 2.0
36 stars 12 forks source link

Use the Promise .notify() instead of simple callback #14

Closed davinkevin closed 8 years ago

davinkevin commented 8 years ago

It's a better implementation to use a promise instead of callback.

The lifecycle should be :

Connection WS : Promise X (like today) Each Subscribe : Promise Y1, Y2, Y3 => Success : if the subscription end well => Error : function if the subscription has been aborted => Notify : All the message receive during the subscription

This behavior is more representative of what a promise has been made for.

davinkevin commented 8 years ago

Doesn't seem to be part of the promise spec... I don't think this should be a good idea

davinkevin commented 8 years ago

A way to do it will to work with Observable, but that will add a lot of code in the lib and modify the API without adding extra value.

I close the ticket