@blocklet/payment-react
Version:
Reusable react components for payment kit v2
18 lines (17 loc) • 483 B
TypeScript
type CacheStrategy = 'session' | 'local' | 'memory';
interface CacheOptions {
strategy?: CacheStrategy;
ttl?: number;
}
export declare class CachedRequest {
private cacheKey;
private fetchData;
private options;
constructor(cacheKey: string, fetchData: () => Promise<any>, options?: CacheOptions);
private getCache;
private getCachedData;
private setCachedData;
clearCache(): void;
fetch(forceRefresh?: boolean): Promise<any>;
}
export {};