Skip to content

Commit

Permalink
fix: expose name in Dataloader instance types (#334)
Browse files Browse the repository at this point in the history
* fix: expose name on Dataloader instance

* docs: add changeset
  • Loading branch information
henrinormak authored Feb 10, 2023
1 parent 0a09c56 commit e286f66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-planes-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'dataloader': patch
---

Added missing type definition for Dataloader.name
8 changes: 8 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ declare class DataLoader<K, V, C = K> {
* change is made. Returns itself for method chaining.
*/
prime(key: K, value: V | PromiseLike<V> | Error): this;


/**
* The name given to this `DataLoader` instance. Useful for APM tools.
*
* Is `null` if not set in the constructor.
*/
name: string | null;
}

declare namespace DataLoader {
Expand Down

0 comments on commit e286f66

Please sign in to comment.