Files
certd/packages/ui/certd-client/src/utils/util.cache.ts
T

18 lines
304 B
TypeScript
Raw Normal View History

export class Cache {
bucket: Record<string, any> = {};
async get(key: string) {
return this.bucket[key];
}
async set(key: string, value: any, ttl?: number) {
this.bucket[key] = value;
}
async del(key: string) {
delete this.bucket[key];
}
}
export const cache = new Cache();