Skip to content

Commit 67309b2

Browse files
committed
fix: fix missing attributes on DataLoaderCache
1 parent d9ef7db commit 67309b2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.changeset/many-rice-walk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@labdigital/dataloader-cache-wrapper': patch
3+
---
4+
5+
Fix missing attributes on DataLoaderCache

src/wrapper.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ export class DataLoaderCache<K extends NotUndefined, V> {
2424
_cacheStore?: Keyv<V | null>;
2525
_cacheKeyFn: (key: K) => string;
2626

27+
name: string | undefined
28+
2729
constructor(
2830
batchLoadFn: BatchLoadFn<K, V | null>,
2931
options: Options<K, V, string>,
3032
) {
3133
this._cacheKeyFn = options.cacheKeyFn;
34+
this.name = options.name
3235

3336
let wrappedBatchLoadFn: BatchLoadFn<K, V | null>;
3437
if (options.cache) {
@@ -58,6 +61,10 @@ export class DataLoaderCache<K extends NotUndefined, V> {
5861
});
5962
}
6063

64+
prime(key: K, value: V | null) {
65+
return this._dataloader.prime(key, value);
66+
}
67+
6168
async load(key: K): Promise<V | null> {
6269
return this._dataloader.load(key);
6370
}

0 commit comments

Comments
 (0)