0.7.2 • Published 2 months ago

@extra-memoize/blackglory-cache-service v0.7.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@extra-memoize/blackglory-cache-service

Install

npm install --save @extra-memoize/blackglory-cache-service
# or
yarn add @extra-memoize/blackglory-cache-service

API

AsyncCacheService

class AsyncCacheService<T> implements IAsyncCache<T> {
  constructor(
    client: CacheClient
  , namespace: string
  , 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
  )
}
0.5.4

2 months ago

0.7.2

2 months ago

0.7.1

11 months ago

0.7.0

1 year ago

0.6.0

1 year ago

0.5.3

1 year ago

0.5.2

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.5.1

2 years ago

0.3.0

2 years ago

0.4.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago