doowb/angular-pusher — pull request #17 by igmcdowell (2014-08-01 17:29:31+00:00)
Title: Pusher.subscribe returns a promise for the channel

In the current implementation it is difficult to use some Pusher API features as subscribing does not return a reference to the channel.

Since Pusher.subscribe is async in this codebase, I added a dependency on $q and changed subscribe to return a promise that gets filled with the channel when it is subscribed. This allows using functionality like channel.members on a presence channel.

In theory this would also allow for dropping eventName and callback from the subscribe method signature; consuming clients could write their own bindings as in the standard pusher-js library. I left as is for now, since this would constitute a breaking change.