UNPKG

idmp

Version:

A lightweight TypeScript library for deduplicating and caching async function calls with automatic retries, designed for idempotent network requests in React and Node.js.

11 lines (10 loc) 428 B
import { Idmp, IdmpOptions, IdmpPromise } from 'idmp'; declare const cacheDir: string; declare const getCachePath: (globalKey: string) => string; declare const fsIdmpWrap: (_idmp: Idmp, namespace?: string) => { <T>(globalKey: string, promiseFunc: IdmpPromise<T>, options?: IdmpOptions): Promise<any>; flush(globalKey: string): void; flushAll(): void; }; export default fsIdmpWrap; export { cacheDir, getCachePath };