0.7.3 • Published 6 months ago
@extra-memoize/blackglory-cache-service v0.7.3
@extra-memoize/blackglory-cache-service
Install
npm install --save @extra-memoize/blackglory-cache-service
# or
yarn add @extra-memoize/blackglory-cache-serviceAPI
AsyncCacheService
class AsyncCacheService<T> implements IAsyncCache<T> {
constructor(
client: CacheClient
, namespace: string
, timeToLive: number | null = null
, toString: (value: T) => string = defaultToString
, fromString: (text: string) => T = defaultFromString
)
}StaleWhileRevalidateAsyncCacheService
class StaleWhileRevalidateAsyncCacheService<T> implements IStaleWhileRevalidateAsyncCache<T> {
constructor(
client: CacheClient
, namespace: string
, timeToLive: number
, staleWhileRevalidate: number
, toString: (value: T) => string = defaultToString
, fromString: (text: string) => T = defaultFromString
)
}StaleIfErrorAsyncCacheService
class StaleIfErrorAsyncCacheService<T> implements IStaleIfErrorAsyncCache<T> {
constructor(
client: CacheClient
, namespace: string
, timeToLive: number
, staleIfError: number
, toString: (value: T) => string = defaultToString
, fromString: (text: string) => T = defaultFromString
)
}StaleWhileRevalidateAndStaleIfErrorAsyncCacheService
class StaleWhileRevalidateAndStaleIfErrorAsyncCacheService<T> implements IStaleWhileRevalidateAndStaleIfErrorAsyncCache<T> {
constructor(
client: CacheClient
, namespace: string
, timeToLive: number
, staleWhileRevalidate: number
, staleIfError: number
, toString: (value: T) => string = defaultToString
, fromString: (text: string) => T = defaultFromString
)
}