From 57d422f7c197fedad54908e17a5824a4c7fa01dd Mon Sep 17 00:00:00 2001 From: Leonardo Dominguez Date: Sun, 5 May 2019 12:08:39 -0400 Subject: [PATCH] add: namespace name property to options object --- src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 1748faf..cea8ef0 100644 --- a/src/index.js +++ b/src/index.js @@ -17,7 +17,8 @@ export default class VueSocketIO { Logger.debug = debug; this.io = this.connect(connection, options); - this.useConnectionNamespace = (options && options.useConnectionNamespace) || false; + this.useConnectionNamespace = (options && options.useConnectionNamespace); + this.namespaceName = (options && options.namespaceName); this.emitter = new Emitter(vuex); this.listener = new Listener(this.io, this.emitter); @@ -29,7 +30,7 @@ export default class VueSocketIO { */ install(Vue){ - const namespace = this.io.nsp.replace("/", ""); + const namespace = this.namespaceName || this.io.nsp.replace("/", ""); if (this.useConnectionNamespace) { if (typeof Vue.prototype.$socket === "object") {