We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
this
1 parent 77c2cd7 commit d46ff7fCopy full SHA for d46ff7f
src/index.d.ts
@@ -17,7 +17,7 @@
17
*/
18
declare class DataLoader<K, V, C = K> {
19
constructor(
20
- batchLoadFn: DataLoader.BatchLoadFn<K, V>,
+ batchLoadFn: DataLoader.BatchLoadFn<K, V, C>,
21
options?: DataLoader.Options<K, V, C>,
22
);
23
@@ -80,7 +80,8 @@ declare namespace DataLoader {
80
81
// A Function, which when given an Array of keys, returns a Promise of an Array
82
// of values or Errors.
83
- export type BatchLoadFn<K, V> = (
+ export type BatchLoadFn<K, V, C = K> = (
84
+ this: DataLoader<K, V, C>,
85
keys: ReadonlyArray<K>,
86
) => PromiseLike<ArrayLike<V | Error>>;
87
0 commit comments