@nbn23/dataloader
v3.3.1
Published
DataLoader library
Downloads
91
Readme
DataLoader
DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.
Getting Started
Install DataLoader using npm.
npm install --save @nbn23/dataloader
Note: DataLoader assumes a TypeScript environment
Usage
const DataLoader = require("dataloader");
const cache = new CacheRedis();
const itemLoader = new DataLoader((keys) => getItems(keys), cache);
const items = await itemLoader.loadMany([2, 4, 6]);