Skip to content

Commit 200b522

Browse files
committed
Merge both custom cache documentations together
1 parent 23bd362 commit 200b522

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ const myLoader = new DataLoader(someBatchLoadFn, {
293293
})
294294
```
295295

296+
More specifically, any object that implements the methods `get()`, `set()`,
297+
`delete()` and `clear()` methods can be provided. This allows for custom Maps
298+
which implement various [cache algorithms][] to be provided.
299+
296300

297301
## API
298302

@@ -484,17 +488,6 @@ const usernameLoader = new DataLoader(async names => {
484488
```
485489

486490

487-
## Custom Caches
488-
489-
DataLoader can optionally be provided a custom Map instance to use as its
490-
memoization cache. More specifically, any object that implements the methods `get()`,
491-
`set()`, `delete()` and `clear()` can be provided. This allows for custom Maps
492-
which implement various [cache algorithms][] to be provided. By default,
493-
DataLoader uses the standard [Map][] which simply grows until the DataLoader
494-
is released. The default is appropriate when requests to your application are
495-
short-lived.
496-
497-
498491
## Common Back-ends
499492

500493
Looking to get started with a specific back-end? Try the [loaders in the examples directory](/examples).

0 commit comments

Comments
 (0)