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

Vuex error handler has empty data #180

Closed
NomNes opened this issue Jan 24, 2019 · 1 comment
Closed

Vuex error handler has empty data #180

NomNes opened this issue Jan 24, 2019 · 1 comment
Assignees

Comments

@NomNes
Copy link
Contributor

NomNes commented Jan 24, 2019

In Vuex, the SOCKET_error action does not contain a message.

export const actions = {
    SOCKET_error: ({}, data) => console.log(data), // data = undefined
    // BUT!
   SOCKET_any_other_event: ({}, data) => console.log(data) // data = {...}, its ok
}

In component this.$socket.on("error", console.log) works ok, receive an error message

Maybe, change src/listenler.js:41:
From VueSocketIOListenler.staticEvents.forEach(event => this.io.on(event, () => this.onEvent(event)))
To VueSocketIOListenler.staticEvents.forEach(event => this.io.on(event, args => this.onEvent(event, args)))

@MetinSeylan
Copy link
Owner

@NomNes thank you for pr!

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

2 participants