You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+9-8
Original file line number
Diff line number
Diff line change
@@ -393,14 +393,15 @@ Create a new `DataLoader` given a batch loading function and options.
393
393
394
394
-*options*: An optional object of options:
395
395
396
-
| Option Key | Type | Default | Description |
397
-
| ---------- | ---- | ------- | ----------- |
398
-
| *batch* | Boolean | `true` | Set to `false` to disable batching, invoking `batchLoadFn` with a single load key. This is equivalent to setting `maxBatchSize` to `1`.
399
-
| *maxBatchSize* | Number | `Infinity` | Limits the number of items that get passed in to the `batchLoadFn`. May be set to `1` to disable batching.
400
-
| *batchScheduleFn* | Function | See [Batch scheduling](#batch-scheduling) | A function to schedule the later execution of a batch. The function is expected to call the provided callback in the immediate future.
401
-
| *cache* | Boolean | `true` | Set to `false` to disable memoization caching, creating a new Promise and new key in the `batchLoadFn` for every load of the same key. This is equivalent to setting `cacheMap` to `null`.
402
-
| *cacheKeyFn* | Function | `key => key` | Produces cache key for a given load key. Useful when objects are keys and two objects should be considered equivalent.
403
-
| *cacheMap* | Object | `new Map()` | Instance of [Map][] (or an object with a similar API) to be used as cache. May be set to `null` to disable caching.
|`batch`| Boolean |`true`| Set to `false` to disable batching, invoking `batchLoadFn` with a single load key. This is equivalent to setting `maxBatchSize` to `1`. |
399
+
|`maxBatchSize`| Number |`Infinity`| Limits the number of items that get passed in to the `batchLoadFn`. May be set to `1` to disable batching. |
400
+
|`batchScheduleFn`| Function | See [Batch scheduling](#batch-scheduling)| A function to schedule the later execution of a batch. The function is expected to call the provided callback in the immediate future. |
401
+
|`cache`| Boolean |`true`| Set to `false` to disable memoization caching, creating a new Promise and new key in the `batchLoadFn` for every load of the same key. This is equivalent to setting `cacheMap` to `null`. |
402
+
|`cacheKeyFn`| Function |`key => key`| Produces cache key for a given load key. Useful when objects are keys and two objects should be considered equivalent. |
403
+
|`cacheMap`| Object |`new Map()`| Instance of [Map][] (or an object with a similar API) to be used as cache. May be set to `null` to disable caching. |
404
+
|`name`| String |`null`| The name given to this `DataLoader` instance. Useful for APM tools. |
0 commit comments