Skip to content

Commit e286f66

Browse files
authored
fix: expose name in Dataloader instance types (#334)
* fix: expose name on Dataloader instance * docs: add changeset
1 parent 0a09c56 commit e286f66

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.changeset/rare-planes-stare.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'dataloader': patch
3+
---
4+
5+
Added missing type definition for Dataloader.name

src/index.d.ts

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ declare class DataLoader<K, V, C = K> {
5959
* change is made. Returns itself for method chaining.
6060
*/
6161
prime(key: K, value: V | PromiseLike<V> | Error): this;
62+
63+
64+
/**
65+
* The name given to this `DataLoader` instance. Useful for APM tools.
66+
*
67+
* Is `null` if not set in the constructor.
68+
*/
69+
name: string | null;
6270
}
6371

6472
declare namespace DataLoader {

0 commit comments

Comments
 (0)