diff --git a/src/store/data.ts b/src/store/data.ts index 9bd814d..14905bf 100644 --- a/src/store/data.ts +++ b/src/store/data.ts @@ -279,7 +279,7 @@ export const gc = (data: InMemoryData) => { data.records.base.delete(entityKey); data.gcBatch.delete(entityKey); if (storage.current) { - storage.current.remove(prefixKey('r', entityKey)); + persistanceBatch[prefixKey('r', entityKey)] = undefined; } // Delete all the entity's links, but also update the reference count @@ -288,7 +288,7 @@ export const gc = (data: InMemoryData) => { if (linkNode !== undefined) { data.links.base.delete(entityKey); if (storage.current) { - storage.current.remove(prefixKey('l', entityKey)); + persistanceBatch[prefixKey('l', entityKey)] = undefined; } for (const key in linkNode) { updateRCForLink(data.gcBatch, data.refCount, linkNode[key], -1); diff --git a/src/store/store.test.ts b/src/store/store.test.ts index 32ca48c..6cdabda 100644 --- a/src/store/store.test.ts +++ b/src/store/store.test.ts @@ -424,7 +424,6 @@ describe('Store with storage', () => { const storage: StorageAdapter = { read: jest.fn(), write: jest.fn(), - remove: jest.fn(), }; let store = new Store(); diff --git a/src/types.ts b/src/types.ts index 200030b..1a48314 100644 --- a/src/types.ts +++ b/src/types.ts @@ -180,7 +180,6 @@ export interface SerializedEntries { export interface StorageAdapter { read(): Promise; - remove(key: string): Promise; write(data: SerializedEntries): Promise; }