UNPKG

@croct/cache

Version:

An abstraction layer for caching.

13 lines (12 loc) 461 B
import { CacheProvider } from './cacheProvider'; /** * A cache that prefixes keys with a string. */ export declare class PrefixedCache<V> implements CacheProvider<string, V> { private readonly inner; private readonly prefix; constructor(inner: CacheProvider<string, V>, prefix: string); get(key: string, loader: (key: string) => Promise<V>): Promise<V>; set(key: string, value: V): Promise<void>; delete(key: string): Promise<void>; }