Skip to content

Commit

Permalink
docs: update documentation for publish and subscribe (#1936)
Browse files Browse the repository at this point in the history
The return types for `subscribeAsync` und `publishAsync` where not up to
date.

Closes #1788
  • Loading branch information
TooAngel committed Sep 9, 2024
1 parent 1ca3f9e commit 72c008d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -613,15 +613,16 @@ Publish a message to a topic
- `subscriptionIdentifier`: representing the identifier of the subscription `number`,
- `contentType`: String describing the content of the Application Message `string`
- `cbStorePut` - `function ()`, fired when message is put into `outgoingStore` if QoS is `1` or `2`.
- `callback` - `function (err)`, fired when the QoS handling completes,
- `callback` - `function (err, packet)`, fired when the QoS handling completes,
or at the next tick if QoS 0. An error occurs if client is disconnecting.

<a name="publish-async"></a>

### mqtt.Client#publishAsync(topic, message, [options])

Async [`publish`](#publish). Returns a `Promise<void>`.
Async [`publish`](#publish). Returns a `Promise<Packet | undefined>`.

A packet is anything that has a `messageId` property.
---

<a name="subscribe"></a>
Expand Down Expand Up @@ -653,7 +654,7 @@ Subscribe to a topic or topics
### mqtt.Client#subscribeAsync(topic/topic array/topic object, [options])
Async [`subscribe`](#subscribe). Returns a `Promise<granted[]>`.
Async [`subscribe`](#subscribe). Returns a `Promise<ISubscriptionGrant[]>`.
---
Expand Down

0 comments on commit 72c008d

Please sign in to comment.