Skip to content
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

Node version affecting event listener callbacks #60

Closed
arjasco opened this issue Oct 28, 2016 · 0 comments
Closed

Node version affecting event listener callbacks #60

arjasco opened this issue Oct 28, 2016 · 0 comments

Comments

@arjasco
Copy link

arjasco commented Oct 28, 2016

So i've just experienced what could be a bug or i've misunderstood something. I'm not a fan of TS or i would dig around the code myself.

I have been running Node 6.4.0 and found that i needed a second parameter in my event listeners callback to retrieve the event data, the first parameter became the channel name. However using node 4.6.0 i only require one parameter for the data.

Example:

Node 4.6.0

this.socket.private('Channel').listen('Event', payload => {
  this.update(payload.data)
})

Node 6.4.0

this.socket.private('Channel').listen('Event', (channel, payload) => {
  this.update(payload.data)
})

I haven't checked against other node versions yet. Not sure if this is something to do with webpack / ES6 complier maybe?

@arjasco arjasco closed this as completed Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant