Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
move to an undefined setter instead
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Dec 14, 2019
1 parent 0a500cc commit ea1b1c8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/store/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/store/store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ describe('Store with storage', () => {
const storage: StorageAdapter = {
read: jest.fn(),
write: jest.fn(),
remove: jest.fn(),
};
let store = new Store();

Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ export interface SerializedEntries {

export interface StorageAdapter {
read(): Promise<SerializedEntries>;
remove(key: string): Promise<void>;
write(data: SerializedEntries): Promise<void>;
}

Expand Down

0 comments on commit ea1b1c8

Please sign in to comment.