@extra-memoize/blackglory-cache-service
v0.8.1
Published
```sh npm install --save @extra-memoize/blackglory-cache-service # or yarn add @extra-memoize/blackglory-cache-service ```
Readme
@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
, options: {
toJSONValue: (value: T) => JSONValue
fromJSONValue: (json: JSONValue) => T
timeToLive?: number | null = null
}
)
}StaleWhileRevalidateAsyncCacheService
class StaleWhileRevalidateAsyncCacheService<T> implements IStaleWhileRevalidateAsyncCache<T> {
constructor(
client: CacheClient
, namespace: string
, options: {
toJSONValue: (value: T) => JSONValue
fromJSONValue: (json: JSONValue) => T
timeToLive: number
staleWhileRevalidate: number
}
)
}StaleIfErrorAsyncCacheService
class StaleIfErrorAsyncCacheService<T> implements IStaleIfErrorAsyncCache<T> {
constructor(
client: CacheClient
, namespace: string
, options: {
toJSONValue: (value: T) => JSONValue
fromJSONValue: (json: JSONValue) => T
timeToLive: number
staleIfError: number
}
)
}StaleWhileRevalidateAndStaleIfErrorAsyncCacheService
class StaleWhileRevalidateAndStaleIfErrorAsyncCacheService<T> implements IStaleWhileRevalidateAndStaleIfErrorAsyncCache<T> {
constructor(
client: CacheClient
, namespace: string
, options: {
toJSONValue: (value: T) => JSONValue
fromJSONValue: (json: JSONValue) => T
timeToLive: number
staleWhileRevalidate: number
staleIfError: number
}
)
}