Skip to content

feat(): Multiple connections - #288

Open
aripjanovsh wants to merge 2 commits into
MetinSeylan:masterfrom
aripjanovsh:master
Open

feat(): Multiple connections#288
aripjanovsh wants to merge 2 commits into
MetinSeylan:masterfrom
aripjanovsh:master

Conversation

@aripjanovsh

Copy link
Copy Markdown

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
Copy Markdown

is this ok? i need this update! please!

@N3R00

N3R00 commented Jun 18, 2022

Copy link
Copy Markdown

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