Constructors
constructor
- new Cache<V>(cache?: Map<any, {
value: V;
tag?: Tag;
expires: number;
}>, tagMap?: Map<Tag, Set<string>>): Cache<V>
-
Parameters
-
cache: Map<any, {
value: V;
tag?: Tag;
expires: number;
}> = ...
-
tagMap: Map<Tag, Set<string>> = ...
Returns Cache<V>
Properties
Protected
Readonly
cache
cache
: Map<any, { value
: V; tag
?: Tag; expires
: number; }> = ...
Protected
Readonly
tagMap
tag
Map
: Map<Tag, Set<string>> = ...
Methods
clearDeadCache
- clearDeadCache(): void
-
Returns void
get
- get(key: any): null | V
-
Returns null | V
set
- set(key: any, value: V, cacheConfig?: {
timeout?: number;
tag?: Tag;
}): void
-
Parameters
-
key: any
-
value: V
-
cacheConfig: {
timeout?: number;
tag?: Tag;
} = {}
-
Optional
timeout?: number
-
Optional
tag?: Tag
Returns void
delete
- delete(key: any): void
-
Returns void
deleteByTag
- deleteByTag(tag: Tag): void
-
Returns void
clear
- clear(): void
-
Returns void
has
- has(key: any): boolean
-
Returns boolean
缓存管理类