refactor: remove unused unsubscribe function from journalStream
This commit is contained in:
parent
960e310208
commit
c9c977bee1
|
|
@ -60,7 +60,7 @@ export type { SessionManifest } from "../../workers/journal.worker";
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
let _workerAPI: Comlink.Remote<JournalWorkerAPI> | null = null;
|
||||
let _unsubscribe: (() => void) | null = null;
|
||||
|
||||
|
||||
function getWorkerAPI(): Comlink.Remote<JournalWorkerAPI> {
|
||||
if (!_workerAPI) {
|
||||
|
|
@ -226,7 +226,7 @@ async function ensureSubscribed(): Promise<void> {
|
|||
_subscribed = true;
|
||||
|
||||
const api = getWorkerAPI();
|
||||
_unsubscribe = await api.subscribe(
|
||||
await api.subscribe(
|
||||
Comlink.proxy((patch: WorkerPatch) => {
|
||||
handlePatch(patch);
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -496,7 +496,7 @@ const api = {
|
|||
},
|
||||
|
||||
/** Register a callback for state patches. Sends full state immediately. */
|
||||
subscribe(callback: Comlink.ProxyOrClone<PatchCallback>): () => void {
|
||||
subscribe(callback: Comlink.ProxyOrClone<PatchCallback>): void {
|
||||
const cb = callback as PatchCallback;
|
||||
subscribers.add(cb);
|
||||
// Send initial full state
|
||||
|
|
@ -513,9 +513,6 @@ const api = {
|
|||
} catch {
|
||||
// ignore
|
||||
}
|
||||
return () => {
|
||||
subscribers.delete(cb);
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue