From 3cf1532138394206c5c8e3f9084735833299ceb9 Mon Sep 17 00:00:00 2001 From: Nikita Galaiko Date: Tue, 30 May 2023 14:46:37 +0200 Subject: [PATCH] rm unused store --- src/lib/api/ipc/deltas.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/lib/api/ipc/deltas.ts b/src/lib/api/ipc/deltas.ts index 197224fe3..7140e9693 100644 --- a/src/lib/api/ipc/deltas.ts +++ b/src/lib/api/ipc/deltas.ts @@ -1,5 +1,4 @@ import { invoke, listen } from '$lib/ipc'; -import { asyncWritable, type WritableLoadable } from '@square/svelte-store'; export type OperationDelete = { delete: [number, number] }; export type OperationInsert = { insert: [number, string] }; @@ -32,21 +31,3 @@ export const subscribe = ( `project://${params.projectId}/sessions/${params.sessionId}/deltas`, (event) => callback({ ...params, ...event.payload }) ); - -const stores: Record>>> = {}; - -export const Deltas = (params: { projectId: string; sessionId: string }) => { - const projectStores = stores[params.projectId] || {}; - if (params.sessionId in projectStores) return projectStores[params.sessionId]; - - const store = asyncWritable([], () => list(params)); - subscribe(params, ({ filePath, deltas }) => { - store.update((deltasCache) => ({ - ...deltasCache, - [filePath]: deltas - })); - }); - projectStores[params.sessionId] = store; - stores[params.projectId] = projectStores; - return store; -};