@stonecrop/beam 0.3.7 → 0.3.8
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/dist/beam.d.ts +1 -1
- package/dist/beam.js +3 -2
- package/dist/beam.js.map +1 -1
- package/dist/beam.umd.cjs +1 -1
- package/dist/beam.umd.cjs.map +1 -1
- package/dist/composables/mqtt.js +2 -2
- package/dist/src/composables/mqtt.d.ts +1 -1
- package/dist/src/composables/mqtt.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/composables/mqtt.ts +3 -3
package/dist/composables/mqtt.js
CHANGED
|
@@ -7,7 +7,7 @@ import { onMounted, onUnmounted, ref } from 'vue';
|
|
|
7
7
|
* @beta
|
|
8
8
|
*/
|
|
9
9
|
export const useMqttStream = (options) => {
|
|
10
|
-
const client = ref(
|
|
10
|
+
const client = ref();
|
|
11
11
|
const messages = ref({});
|
|
12
12
|
onMounted(() => {
|
|
13
13
|
client.value = mqtt.connect(options);
|
|
@@ -29,7 +29,7 @@ export const useMqttStream = (options) => {
|
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
onUnmounted(() => {
|
|
32
|
-
client.value
|
|
32
|
+
client.value?.end();
|
|
33
33
|
});
|
|
34
34
|
return { messages };
|
|
35
35
|
};
|
|
@@ -5,7 +5,7 @@ import { IMqttStream } from '../types';
|
|
|
5
5
|
* @returns MQTT stream messages
|
|
6
6
|
* @beta
|
|
7
7
|
*/
|
|
8
|
-
export declare const useMqttStream: (options
|
|
8
|
+
export declare const useMqttStream: (options: IMqttStream) => {
|
|
9
9
|
messages: import("vue").Ref<Record<string, string[]>, Record<string, string[]>>;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=mqtt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mqtt.d.ts","sourceRoot":"","sources":["../../../src/composables/mqtt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"mqtt.d.ts","sourceRoot":"","sources":["../../../src/composables/mqtt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAa,WAAW;;CAiCjD,CAAA"}
|
package/package.json
CHANGED
package/src/composables/mqtt.ts
CHANGED
|
@@ -9,8 +9,8 @@ import { IMqttStream } from '../types'
|
|
|
9
9
|
* @returns MQTT stream messages
|
|
10
10
|
* @beta
|
|
11
11
|
*/
|
|
12
|
-
export const useMqttStream = (options
|
|
13
|
-
const client = ref<MqttClient>(
|
|
12
|
+
export const useMqttStream = (options: IMqttStream) => {
|
|
13
|
+
const client = ref<MqttClient>()
|
|
14
14
|
const messages = ref<Record<string, string[]>>({})
|
|
15
15
|
|
|
16
16
|
onMounted(() => {
|
|
@@ -38,7 +38,7 @@ export const useMqttStream = (options?: IMqttStream) => {
|
|
|
38
38
|
})
|
|
39
39
|
|
|
40
40
|
onUnmounted(() => {
|
|
41
|
-
client.value
|
|
41
|
+
client.value?.end()
|
|
42
42
|
})
|
|
43
43
|
|
|
44
44
|
return { messages }
|