@faybl/client 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -26
- package/package.json +1 -1
- package/src/mqttUtils.js +1 -1
package/README.md
CHANGED
|
@@ -155,7 +155,8 @@ subscription may be a filter with wildcards.
|
|
|
155
155
|
MQTT.js's, such as `{ qos, retain }`.
|
|
156
156
|
- `mqttClient.subscribe(topic, callback, { qos })` returns the function that undoes it. The
|
|
157
157
|
callback gets `{ topic, data }`, with `data` parsed from JSON.
|
|
158
|
-
- `mqttClient.subscribeWithAck(topic, callback, { qos })` returns `{ ready, unsubscribe }
|
|
158
|
+
- `mqttClient.subscribeWithAck(topic, callback, { qos })` returns `{ ready, unsubscribe }`; `ready`
|
|
159
|
+
resolves once the broker has granted the QoS asked for, 0 by default.
|
|
159
160
|
- `mqttClient.unsubscribe(topic, callback)`. Without a callback it removes every callback on the
|
|
160
161
|
topic.
|
|
161
162
|
|
|
@@ -217,31 +218,6 @@ machine of your own. It is in `Init` while it loads, then `Idle`, or `Error` wit
|
|
|
217
218
|
`datasetLoaded(actorRef)` resolves with the records once it is `Idle`, and rejects with the error
|
|
218
219
|
when it ends in `Error`.
|
|
219
220
|
|
|
220
|
-
## Releasing
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
npm version patch # or minor, major, or an exact version
|
|
224
|
-
npm version prerelease --preid=rc
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
`.npmrc` sets `tag-version-prefix=version/`, so the tag is `version/4.0.0`. `preversion` runs
|
|
228
|
-
`npm run verify`, and `postversion` says what to do next; nothing is pushed or published on its
|
|
229
|
-
own. Then either publish from here:
|
|
230
|
-
|
|
231
|
-
```
|
|
232
|
-
npm run release
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
or push the tag, and CI publishes it through npm trusted publishing:
|
|
236
|
-
|
|
237
|
-
```
|
|
238
|
-
git push --follow-tags
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
`npm run release` refuses to upload unless the working tree is clean, HEAD carries the tag of the
|
|
242
|
-
current version and there is an npm login or a CI token. A version already on the registry is
|
|
243
|
-
skipped, so publishing locally and then pushing the tag is a no-op in CI.
|
|
244
|
-
|
|
245
221
|
## License
|
|
246
222
|
|
|
247
223
|
MIT, see [LICENSE](LICENSE).
|
package/package.json
CHANGED
package/src/mqttUtils.js
CHANGED
|
@@ -85,7 +85,7 @@ export const createMqttHandler = (client, { report = () => undefined } = {}) =>
|
|
|
85
85
|
return () => unsubscribe(topic, callback);
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
const subscribeWithAck = (topic, callback, { qos, preCallback } = {}) => {
|
|
88
|
+
const subscribeWithAck = (topic, callback, { qos = 0, preCallback } = {}) => {
|
|
89
89
|
dispatch({ type: 'add', topic, callback, preCallback });
|
|
90
90
|
const ready = new Promise((resolve, reject) => {
|
|
91
91
|
client.subscribe(topic, { qos }, (error, granted) => {
|