@stonecrop/beam 0.13.4 → 0.13.5

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 CHANGED
@@ -162,6 +162,6 @@ export { ToggleArrow }
162
162
  */
163
163
  export declare const useMqttStream: (options: IMqttStream) => Promise<{
164
164
  messages: Ref<Record<string, string[]>, Record<string, string[]>>;
165
- } | undefined>;
165
+ }>;
166
166
 
167
167
  export { }
package/dist/beam.js CHANGED
@@ -11469,22 +11469,23 @@ var El, kh = Qe(() => {
11469
11469
  });
11470
11470
  const Ph = Oh();
11471
11471
  const Mh = async (l) => {
11472
+ const u = Tt({});
11472
11473
  if (l.host && l.port && !await Ch(l.host, l.port))
11473
- return;
11474
- const u = Tt(), s = Tt({});
11474
+ return { messages: u };
11475
+ const s = Tt();
11475
11476
  return uo(() => {
11476
- u.value = Ph.connect(l), l.topics || (l.topics = ["#"]);
11477
+ s.value = Ph.connect(l), l.topics || (l.topics = ["#"]);
11477
11478
  for (const o of l.topics)
11478
- u.value.subscribe(o, (a) => {
11479
+ s.value.subscribe(o, (a) => {
11479
11480
  if (a)
11480
11481
  throw a;
11481
11482
  });
11482
- u.value.on("message", (o, a) => {
11483
- s.value[o] || (s.value[o] = []), s.value[o].push(a.toString());
11483
+ s.value.on("message", (o, a) => {
11484
+ u.value[o] || (u.value[o] = []), u.value[o].push(a.toString());
11484
11485
  });
11485
11486
  }), co(() => {
11486
- u.value?.end();
11487
- }), { messages: s };
11487
+ s.value?.end();
11488
+ }), { messages: u };
11488
11489
  }, Ch = async (l, u) => {
11489
11490
  try {
11490
11491
  const s = new AbortController(), o = setTimeout(() => s.abort(), 2e3);