|
|
@ -7,7 +7,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
if(!this.sockets) this.sockets = {};
|
|
|
|
if(!this.sockets) this.sockets = {};
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof this.$vueSocketIo === 'object') {
|
|
|
|
if (typeof this.$vueSocketIo === 'object' && this.$useConnectionNamespace) {
|
|
|
|
for (const namespace of Object.keys(this.$vueSocketIo)) {
|
|
|
|
for (const namespace of Object.keys(this.$vueSocketIo)) {
|
|
|
|
this.sockets[namespace] = {
|
|
|
|
this.sockets[namespace] = {
|
|
|
|
subscribe: (event, callback) => {
|
|
|
|
subscribe: (event, callback) => {
|
|
|
@ -31,7 +31,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
if(this.$options.sockets){
|
|
|
|
if(this.$options.sockets){
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof this.$vueSocketIo === 'object') {
|
|
|
|
if (typeof this.$vueSocketIo === 'object' && this.$useConnectionNamespace) {
|
|
|
|
for (const namespace of Object.keys(this.$vueSocketIo)) {
|
|
|
|
for (const namespace of Object.keys(this.$vueSocketIo)) {
|
|
|
|
if (this.$options.sockets[namespace]) {
|
|
|
|
if (this.$options.sockets[namespace]) {
|
|
|
|
Object.keys(this.$options.sockets[namespace]).forEach(event => {
|
|
|
|
Object.keys(this.$options.sockets[namespace]).forEach(event => {
|
|
|
@ -45,7 +45,6 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Object.keys(this.$options.sockets).forEach(event => {
|
|
|
|
Object.keys(this.$options.sockets).forEach(event => {
|
|
|
|
|
|
|
|
|
|
|
|
if(event !== 'subscribe' && event !== 'unsubscribe') {
|
|
|
|
if(event !== 'subscribe' && event !== 'unsubscribe') {
|
|
|
|
this.$vueSocketIo.emitter.addListener(event, this.$options.sockets[event], this);
|
|
|
|
this.$vueSocketIo.emitter.addListener(event, this.$options.sockets[event], this);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -63,7 +62,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
if(this.$options.sockets){
|
|
|
|
if(this.$options.sockets){
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof this.$vueSocketIo === 'object') {
|
|
|
|
if (typeof this.$vueSocketIo === 'object' && this.$useConnectionNamespace) {
|
|
|
|
for (const namespace of Object.keys(this.$vueSocketIo)) {
|
|
|
|
for (const namespace of Object.keys(this.$vueSocketIo)) {
|
|
|
|
if (this.$options.sockets[namespace]) {
|
|
|
|
if (this.$options.sockets[namespace]) {
|
|
|
|
Object.keys(this.$options.sockets[namespace]).forEach(event => {
|
|
|
|
Object.keys(this.$options.sockets[namespace]).forEach(event => {
|
|
|
@ -85,4 +84,5 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|