import { CancelFn, PromiseAndCancel } from '../links/types'; declare type BatchLoader = { validate: (keys: TKey[]) => boolean; fetch: (keys: TKey[]) => { promise: Promise; cancel: CancelFn; }; }; /** * Dataloader that's very inspired by https://github.com/graphql/dataloader * Less configuration, no caching, and allows you to cancel requests * When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled */ export declare function dataLoader(batchLoader: BatchLoader): { load: (key: TKey) => PromiseAndCancel; }; export {}; //# sourceMappingURL=dataLoader.d.ts.map