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

feat(): Multiple connections #288

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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

@Arturokin
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.

None yet

4 participants