Vue-Socket.io icon indicating copy to clipboard operation
Vue-Socket.io copied to clipboard

feat(): Multiple connections

Open aripjanovsh opened this issue 4 years ago • 2 comments

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
}))

aripjanovsh avatar Oct 27 '20 12:10 aripjanovsh

is this ok? i need this update! please!

Arturokin avatar Jul 05 '21 22:07 Arturokin

work without vuex?

N3R00 avatar Jun 18 '22 04:06 N3R00