From 1d8ffb9b9bf911aeba8fcc5f1c282fea39c53934 Mon Sep 17 00:00:00 2001 From: sclausen Date: Thu, 3 Jan 2019 16:07:49 +0100 Subject: [PATCH] Clarify publish behavior. Resolves #125. --- src/mqtt.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mqtt.service.ts b/src/mqtt.service.ts index 85a42fa..11f5cf3 100644 --- a/src/mqtt.service.ts +++ b/src/mqtt.service.ts @@ -215,9 +215,10 @@ export class MqttService { } /** - * This method publishes a message for a topic with optional options. - * The returned observable will emit empty value and complete, if publishing was successful - * and will throw an error, if the publication fails. + * This method returns an observable for a topic with optional options. + * After subscribing, the actual mqtt publication will be executed and + * the observable will emit an empty value and completes, if publishing was successful + * or throws an error, if the publication fails. */ public publish(topic: string, message: any, options?: IPublishOptions): Observable { if (!this.client) {