Migration from vue-socket.io to vue-socket.io-extended
adamasantares opened this issue · 3 comments
adamasantares commented
For everyone who has migrated from old package to this new one on existing project.
You need to redefine 2 parameters so you will be able to use old store action names like "SOCKET_EVENT_NAME":
import VueSocketIO from 'vue-socket.io-extended';
import io from 'socket.io-client';
const ioInstance = io('https://hostname/path', {
reconnection: true,
reconnectionDelay: 500,
maxReconnectionAttempts: Infinity
});
Vue.use(VueSocketIO, ioInstance, {
store,
actionPrefix: 'SOCKET_', // keep prefix in uppercase
eventToActionTransformer: (actionName) => actionName // cancel camel case
}
});
probil commented
Thanks @adamasantares
Can you please add it to the README file? I'd consider it as useful for others
adamasantares commented
np, pull request is awaiting.
probil commented
Merged