Skip to content

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

GenericCache

Source

caching/GenericCache.ts:6

Methods

get()

get<T>(cacheKey): Promise<null | T & ICachable>

Type parameters

• T

Parameters

• cacheKey: string

Returns

Promise<null | T & ICachable>

Implementation of

ICachingStrategy.get

Source

caching/GenericCache.ts:46


getOrCreate()

getOrCreate<T>(cacheKey, createFunction, updateFunction?): Promise<T & ICachable>

Type parameters

• T

Parameters

• cacheKey: string

• createFunction

• updateFunction?

Returns

Promise<T & ICachable>

Implementation of

ICachingStrategy.getOrCreate

Source

caching/GenericCache.ts:20


remove()

remove(cacheKey): Promise<void>

Parameters

• cacheKey: string

Returns

Promise<void>

Implementation of

ICachingStrategy.remove

Source

caching/GenericCache.ts:100


set()

set(cacheKey, value, expiresIn): Promise<void>

Parameters

• cacheKey: string

• value: object

• expiresIn: number

Returns

Promise<void>

Source

caching/GenericCache.ts:82


setCacheItem()

setCacheItem(cacheKey, cacheItem): Promise<void>

Parameters

• cacheKey: string

• cacheItem: ICachable

Returns

Promise<void>

Implementation of

ICachingStrategy.setCacheItem

Source

caching/GenericCache.ts:92