Merge branch 'master' into master

This commit is contained in:
Zack Neyland 2018-06-15 09:42:01 -07:00 committed by GitHub
commit f26cbed056
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 29 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
node_modules/
npm-debug.log
.idea/
package-lock.json

2
dist/build.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"name": "vue-socket.io",
"version": "2.1.1-a",
"version": "2.1.1-b",
"description": "socket.io implemantation for vuejs and vuex",
"main": "dist/build.js",
"scripts": {
@ -29,7 +29,7 @@
},
"homepage": "https://github.com/MetinSeylan/Vue-Socket.io#readme",
"dependencies": {
"socket.io-client": "^1.4.6"
"socket.io-client": "^2.0.0"
},
"devDependencies": {
"babel-cli": "^6.11.4",

View file

@ -22,7 +22,7 @@ export default class{
this.Socket.onevent = (packet) => {
super_onevent.call(this.Socket, packet);
Emitter.emit(packet.data[0], packet.data[1]);
Emitter.emit.apply(Emitter, packet.data);
if (this.store) this.passToStore('SOCKET_' + packet.data[0], [...packet.data.slice(1)])
};
@ -54,7 +54,8 @@ export default class{
let camelcased = 'socket_'+event
.replace('SOCKET_', '')
.replace(/^([A-Z])|[\W\s_]+(\w)/g, (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase())
.toLowerCase()
.replace(/[\W\s_]+(\w)/g, (match, p1) => p1.toUpperCase())
if (action === camelcased) this.store.dispatch(namespaced, payload)
}