@spash/frontlib 0.0.29-beta.1 → 0.0.29
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/main.d.ts +1 -1
- package/dist/main.js +9 -9
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -707,7 +707,7 @@ export declare const useLuxon: () => {
|
|
|
707
707
|
|
|
708
708
|
export declare const useSse: (apiUrl?: string) => {
|
|
709
709
|
eventSource: Ref<EventSource | undefined, EventSource | undefined>;
|
|
710
|
-
addSubscriber: (topics: string[], callback?: SseCallback) => EventSource;
|
|
710
|
+
addSubscriber: (topics: string[] | string, callback?: SseCallback) => EventSource;
|
|
711
711
|
getActiveSseConnections: () => EventSource[];
|
|
712
712
|
closeAllConnections: () => void;
|
|
713
713
|
};
|
package/dist/main.js
CHANGED
|
@@ -37570,16 +37570,16 @@ const i7 = () => {
|
|
|
37570
37570
|
};
|
|
37571
37571
|
}, Os = /* @__PURE__ */ new Set(), o7 = (n) => {
|
|
37572
37572
|
const e = ve(), t = (o, a) => {
|
|
37573
|
-
const l = new URL(`${n}/.well-known/mercure`);
|
|
37574
|
-
for (const
|
|
37575
|
-
l.searchParams.append("topic",
|
|
37576
|
-
return e.value = new EventSource(l.toString()), Os.add(e.value), a != null && a.onOpen && (e.value.onopen = a.onOpen), a != null && a.onMessage && (e.value.onmessage = (
|
|
37577
|
-
var
|
|
37573
|
+
const l = new URL(`${n}/.well-known/mercure`), c = Array.isArray(o) ? o : [o];
|
|
37574
|
+
for (const u of c)
|
|
37575
|
+
l.searchParams.append("topic", u);
|
|
37576
|
+
return e.value = new EventSource(l.toString()), Os.add(e.value), a != null && a.onOpen && (e.value.onopen = a.onOpen), a != null && a.onMessage && (e.value.onmessage = (u) => {
|
|
37577
|
+
var d;
|
|
37578
37578
|
try {
|
|
37579
|
-
const
|
|
37580
|
-
(
|
|
37581
|
-
} catch (
|
|
37582
|
-
console.warn("SSE message parsing error:",
|
|
37579
|
+
const h = JSON.parse(u.data);
|
|
37580
|
+
(d = a.onMessage) == null || d.call(a, h);
|
|
37581
|
+
} catch (h) {
|
|
37582
|
+
console.warn("SSE message parsing error:", h);
|
|
37583
37583
|
}
|
|
37584
37584
|
}), a != null && a.onError && (e.value.onerror = a.onError), e.value.addEventListener("error", () => {
|
|
37585
37585
|
Os.delete(e.value);
|