GenericCache
Extended by
Implements
Constructors
new GenericCache()
new GenericCache(
storage
,updateFunctions
,autoRenewInterval
,autoRenewWindow
):GenericCache
Parameters
• storage: ICacheStore
• updateFunctions: Map
<string
, (item
) => Promise
<ICachable
>>= undefined
• autoRenewInterval: number
= 0
• autoRenewWindow: number
= undefined
Returns
Source
Methods
get()
get<
T
>(cacheKey
):Promise
<null
|T
&ICachable
>
Type parameters
• T
Parameters
• cacheKey: string
Returns
Promise
<null
| T
& ICachable
>
Implementation of
Source
getOrCreate()
getOrCreate<
T
>(cacheKey
,createFunction
,updateFunction
?):Promise
<T
&ICachable
>
Type parameters
• T
Parameters
• cacheKey: string
• createFunction
• updateFunction?
Returns
Promise
<T
& ICachable
>
Implementation of
Source
remove()
remove(
cacheKey
):Promise
<void
>
Parameters
• cacheKey: string
Returns
Promise
<void
>
Implementation of
Source
set()
set(
cacheKey
,value
,expiresIn
):Promise
<void
>
Parameters
• cacheKey: string
• value: object
• expiresIn: number
Returns
Promise
<void
>
Source
setCacheItem()
setCacheItem(
cacheKey
,cacheItem
):Promise
<void
>
Parameters
• cacheKey: string
• cacheItem: ICachable
Returns
Promise
<void
>