feat(frontend): useSessionStream (EventSource -> store)

This commit is contained in:
2026-06-28 12:19:55 +02:00
parent ebd3988634
commit d238ddd395
3 changed files with 75 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
export class FakeEventSource {
static instances: FakeEventSource[] = [];
onmessage: ((e: { data: string }) => void) | null = null;
onopen: (() => void) | null = null;
onerror: (() => void) | null = null;
closed = false;
constructor(public url: string) {
FakeEventSource.instances.push(this);
}
emit(obj: unknown) {
this.onmessage?.({ data: JSON.stringify(obj) });
}
close() {
this.closed = true;
}
}