Skip to content

Commit

Permalink
Fix get()
Browse files Browse the repository at this point in the history
  • Loading branch information
Exelord committed Mar 27, 2024
1 parent 4a35817 commit 5f97a11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/primitives/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export class SignaledMap<K, V> extends Map<K, V> {
}

get(key: K): V | undefined {
track(key, this.valuesCache);
return super.get(key);
}

Expand Down Expand Up @@ -100,7 +101,6 @@ export class SignaledMap<K, V> extends Map<K, V> {
batch(() => {
dirtyAll(this.keysCache);
dirtyAll(this.valuesCache);
dirty(OBJECT_KEYS, this.keysCache);
});
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/primitives/set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export class SignaledSet<T> extends Set<T> {
if (values) for (const v of values) super.add(v);
}

[Symbol.iterator](): IterableIterator<T> {
return this.values();
}

get size(): number {
track(OBJECT_KEYS, this.valuesCache);
return super.size;
}

[Symbol.iterator](): IterableIterator<T> {
return this.values();
}

keys(): IterableIterator<T> {
return this.values();
}
Expand Down Expand Up @@ -80,7 +80,6 @@ export class SignaledSet<T> extends Set<T> {
super.clear();
batch(() => {
dirtyAll(this.valuesCache);
dirty(OBJECT_KEYS, this.valuesCache);
});
}
}
Expand Down

0 comments on commit 5f97a11

Please sign in to comment.