MetinSeylan / Vue-Socket.io

😻 Socket.io implementation for Vuejs and Vuex
https://metin.sh
MIT License
3.95k stars 499 forks source link

Reconnect event does not to be trigger #335

Open xandros15 opened 2 years ago

xandros15 commented 2 years ago

When I'm using vuex style to register all listeners, reconnect event is not recognized. If I'm using pure io.on it works correct.

My implementation:

import { io } from 'socket.io-client'

const socket = io()

export default socket
import VueSocketIO from 'vue-socket.io'
import store from '../store'
import socket from './socket'

const PREFIX = 'socket.'

const vueSocketIO = new VueSocketIO({
  debug: process.env.NODE_ENV === 'development',
  connection: socket,
  vuex: {
    store,
    actionPrefix: PREFIX,
    mutationPrefix: PREFIX,
  },
})

I'm using socket.io 4.4.1 and vuex 3.6.2