@eduardorothdev/rxjs-mqtt
Advanced tools
Comparing version 1.0.12 to 1.1.0
@@ -12,2 +12,3 @@ import { IClientOptions, IClientReconnectOptions, ISubscriptionMap, MqttClient, Packet, PacketCallback } from "mqtt"; | ||
publish(...args: [string, string | Buffer]): Promise<unknown>; | ||
publishJson(topic: string, data: JSON): Promise<unknown>; | ||
subscribe(...args: [string | string[] | ISubscriptionMap]): Promise<unknown>; | ||
@@ -14,0 +15,0 @@ unsubscribe(...args: [string | string[]]): Promise<unknown>; |
@@ -35,2 +35,12 @@ "use strict"; | ||
} | ||
publishJson(topic, data) { | ||
return new Promise((resolve, reject) => { | ||
this._client.publish(topic, JSON.stringify(data), (err, result) => { | ||
if (err) | ||
reject(err); | ||
else | ||
resolve(result); | ||
}); | ||
}); | ||
} | ||
subscribe(...args) { | ||
@@ -37,0 +47,0 @@ return new Promise((resolve, reject) => { |
{ | ||
"name": "@eduardorothdev/rxjs-mqtt", | ||
"version": "1.0.12", | ||
"version": "1.1.0", | ||
"description": "RxJS wrapper for MQTT. Based on async-mqtt", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -49,2 +49,11 @@ import { | ||
publishJson(topic: string, data: JSON) { | ||
return new Promise((resolve, reject) => { | ||
this._client.publish(topic, JSON.stringify(data), (err, result) => { | ||
if (err) reject(err); | ||
else resolve(result); | ||
}); | ||
}); | ||
} | ||
subscribe(...args: [string | string[] | ISubscriptionMap]) { | ||
@@ -51,0 +60,0 @@ return new Promise((resolve, reject) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23182
583