https://github.com/bugthesystem/dataloader
DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.
https://github.com/bugthesystem/dataloader
Last synced: 7 months ago
JSON representation
DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.
- Host: GitHub
- URL: https://github.com/bugthesystem/dataloader
- Owner: bugthesystem
- License: mit
- Created: 2017-08-10T15:03:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-29T15:08:09.000Z (almost 9 years ago)
- Last Synced: 2025-02-14T13:06:22.513Z (over 1 year ago)
- Language: Scala
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DataLoader
> DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.
### Usage
```scala
val loader = new DataLoader[Int, Int](
batchLoadFn = keys: Array[Int] => Some(Promise().success(keys))
)
val f = loader.load(1)
val result = Await.result(f, 1.seconds)
println(s"Resolved value: $result")
```
### Credits
> https://github.com/facebook/dataloader
@z i λ a s a l