-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the "receive" function available to caller #46
Comments
@moxide I'm facing the same issue, I guess this could be handled in two ways, we can either modify joinChannel(name, params, okHandler) {
...
channel
.join()
.receive("ok", okHandler);
return channel;
} Let's see what's @mike-north take on this. |
Hi, |
Yes, I know the returned object contains the channel, but if we change the return value of the |
ok, got it ;-) |
any say on this? @mike-north |
I just ran into this issue. I ended up writing my own joinChannel(name, params) {
return new Ember.RSVP.Promise((resolve, reject) => {
const socket = get(this, 'socket')
Ember.assert('Must connect to a socket first', socket)
const channel = socket.channel(name, params)
channel.join()
.receive('ok', () => resolve(channel))
.receive('error', (message) => reject(new Error(message)))
})
}, |
Hello,
I just started playing with phoenix's channels and found a small issue with this library.
I try to get information from the reply of the "join" call. According to the doc, this could be done using the
receive
function :But when I try to use
ember-phoenix
:this throws a "receive function is not defined"
So I had to make
ember-phoenix
return thechannel.join()
object instead of thechannel
object, and it works. But now, to access thechannel
object itself, I have to do this :Is there a more "elegant" way to address this issue ?
Thanks !
The text was updated successfully, but these errors were encountered: