@768bit/vue-sock-rpc
Advanced tools
Comparing version 0.0.27 to 0.0.28
@@ -810,5 +810,5 @@ import * as Promise$1 from 'bluebird'; | ||
console.log("Got message", parsed_1); | ||
if (parsed_1 && parsed_1.hasOwnProperty("messageType") && parsed_1.hasOwnProperty("id") && | ||
typeof parsed_1.id === "string" && parsed_1.id !== "") { | ||
if (Emitter$1.hasRequest(parsed_1.id)) { | ||
if (parsed_1 && parsed_1.hasOwnProperty("messageType")) { | ||
if (parsed_1.hasOwnProperty("id") && typeof parsed_1.id === "string" && parsed_1.id !== "" && | ||
Emitter$1.hasRequest(parsed_1.id)) { | ||
var req = Emitter$1.getRequest(parsed_1.id); | ||
@@ -830,13 +830,2 @@ if (parsed_1.messageType === WebSocketMessageType.RPCStatusMessage) { | ||
} | ||
else if (parsed_1.messageType === WebSocketMessageType.PublishMessage) { | ||
//item is a publish message... iterate the handlers for topic and send data... | ||
if (self.subscriptions.has(parsed_1.topic)) { | ||
var st = self.subscriptions.get(parsed_1.topic); | ||
if (st && Array.isArray(st) && st.length > 0) { | ||
st.forEach(function (handler) { | ||
handler(parsed_1.topic, parsed_1.payload.publish); | ||
}); | ||
} | ||
} | ||
} | ||
else { | ||
@@ -848,2 +837,14 @@ Emitter$1.removeRequest(parsed_1.id); | ||
} | ||
else if (parsed_1.messageType === WebSocketMessageType.PublishMessage && | ||
typeof parsed_1.topic === "string" && parsed_1.topic !== "") { | ||
//item is a publish message... iterate the handlers for topic and send data... | ||
if (self.subscriptions.has(parsed_1.topic)) { | ||
var st = self.subscriptions.get(parsed_1.topic); | ||
if (st && Array.isArray(st) && st.length > 0) { | ||
st.forEach(function (handler) { | ||
handler(parsed_1.topic, parsed_1.payload.publish); | ||
}); | ||
} | ||
} | ||
} | ||
return; | ||
@@ -850,0 +851,0 @@ } |
@@ -813,5 +813,5 @@ 'use strict'; | ||
console.log("Got message", parsed_1); | ||
if (parsed_1 && parsed_1.hasOwnProperty("messageType") && parsed_1.hasOwnProperty("id") && | ||
typeof parsed_1.id === "string" && parsed_1.id !== "") { | ||
if (Emitter$1.hasRequest(parsed_1.id)) { | ||
if (parsed_1 && parsed_1.hasOwnProperty("messageType")) { | ||
if (parsed_1.hasOwnProperty("id") && typeof parsed_1.id === "string" && parsed_1.id !== "" && | ||
Emitter$1.hasRequest(parsed_1.id)) { | ||
var req = Emitter$1.getRequest(parsed_1.id); | ||
@@ -833,13 +833,2 @@ if (parsed_1.messageType === WebSocketMessageType.RPCStatusMessage) { | ||
} | ||
else if (parsed_1.messageType === WebSocketMessageType.PublishMessage) { | ||
//item is a publish message... iterate the handlers for topic and send data... | ||
if (self.subscriptions.has(parsed_1.topic)) { | ||
var st = self.subscriptions.get(parsed_1.topic); | ||
if (st && Array.isArray(st) && st.length > 0) { | ||
st.forEach(function (handler) { | ||
handler(parsed_1.topic, parsed_1.payload.publish); | ||
}); | ||
} | ||
} | ||
} | ||
else { | ||
@@ -851,2 +840,14 @@ Emitter$1.removeRequest(parsed_1.id); | ||
} | ||
else if (parsed_1.messageType === WebSocketMessageType.PublishMessage && | ||
typeof parsed_1.topic === "string" && parsed_1.topic !== "") { | ||
//item is a publish message... iterate the handlers for topic and send data... | ||
if (self.subscriptions.has(parsed_1.topic)) { | ||
var st = self.subscriptions.get(parsed_1.topic); | ||
if (st && Array.isArray(st) && st.length > 0) { | ||
st.forEach(function (handler) { | ||
handler(parsed_1.topic, parsed_1.payload.publish); | ||
}); | ||
} | ||
} | ||
} | ||
return; | ||
@@ -853,0 +854,0 @@ } |
{ | ||
"name": "@768bit/vue-sock-rpc", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"description": "Hard fork of nathantsoi/vue-native-websocket that supports scoped/namespaced message capture", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
99013
2254