Skip to content

Conversation

aripjanovsh
Copy link

Added multiple connections
actionPrefix and mutationPrefix functions

import Vue from 'vue'
import store from './store'
import App from './App.vue'
import VueSocketIO from 'vue-socket.io'

const app = SocketIO('http://localhost:1090', {
  useConnectionNamespace: true,
});

const chat = SocketIO('http://localhost:1090/chat', {
  useConnectionNamespace: true,
  autoConnect: false,
});

Vue.use(new VueSocketIO({
    debug: true,
    connection: {
        app,
        chat
    },
    vuex: {
        store,
        actionPrefix: eventName => {
          return (`SOCKET_` + eventName).toUpperCase();
        },
        mutationPrefix: eventName => {
          return (`SOCKET_` + eventName).toUpperCase();
        },
    },
    options: { path: "/my-app/" } //Optional options
}))

@ArturoVicencioParada
Copy link

is this ok? i need this update! please!

@N3R00
Copy link

N3R00 commented Jun 18, 2022

work without vuex?

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

Successfully merging this pull request may close these issues.

4 participants