@forestadmin/forestadmin-client
Version:
This package contains the logic to use the ForestAdmin API inside an agent.
14 lines • 439 B
TypeScript
/**
* Simplest TTL cache for multiple entries
* Handles concurrent fetch by design
*/
export default class TTLCache<V> {
private readonly fetchMethod;
private readonly ttl;
private readonly stateMap;
constructor(fetchMethod: (key: string) => Promise<V | undefined>, ttl?: number);
fetch(key: string): Promise<V | undefined>;
clear(): void;
delete(key: string): void;
}
//# sourceMappingURL=ttl-cache.d.ts.map