@nexex/orderbook
Version:
12 lines (11 loc) • 351 B
TypeScript
/**
* A local cache util
* support loader so if a cache expires, will still return cached value until loader update the cache.
*/
export declare class LocalCache {
private cacheMap;
private timeoutMap;
put(key: string, value: any, expires?: number, loader?: () => any): void;
remove(key: string): void;
get(key: string): any;
}