Interface Status<V>

Status object that may be passed to LRUCache#fetch, LRUCache#get, LRUCache#set, and LRUCache#has.

Type Parameters

  • V

Hierarchy

  • Status

Properties

entrySize?: number

The calculated size for the item, if sizes are used.

fetch?: "miss" | "hit" | "stale" | "get" | "inflight" | "refresh"

The status of a LRUCache#fetch operation. Note that this can change as the underlying fetch() moves through various states.

  • inflight: there is another fetch() for this key which is in process
  • get: there is no fetchMethod, so LRUCache#get was called.
  • miss: the item is not in cache, and will be fetched.
  • hit: the item is in the cache, and was resolved immediately.
  • stale: the item is in the cache, but stale.
  • refresh: the item is in the cache, and not stale, but FetchOptions.forceRefresh was specified.
fetchAbortIgnored?: true

The abort signal received was ignored, and the fetch was allowed to continue.

fetchAborted?: true

The fetch received an abort signal

fetchDispatched?: true

The OptionsBase.fetchMethod was called

fetchError?: Error

The reason for a fetch() rejection. Either the error raised by the OptionsBase.fetchMethod, or the reason for an AbortSignal.

fetchRejected?: true

The fetchMethod promise was rejected

fetchResolved?: true

The fetchMethod promise resolved successfully

fetchUpdated?: true

The cached value was updated after a successful call to OptionsBase.fetchMethod

get?: "miss" | "hit" | "stale"

The status of a LRUCache#get operation.

  • fetching: The item is currently being fetched. If a previous value is present and allowed, that will be returned.
  • stale: The item is in the cache, and is stale.
  • hit: the item is in the cache
  • miss: the item is not in the cache
has?: "miss" | "hit" | "stale"

The results of a LRUCache#has operation

  • hit: the item was found in the cache
  • stale: the item was found in the cache, but is stale
  • miss: the item was not found in the cache
maxEntrySizeExceeded?: true

A flag indicating that the item was not stored, due to exceeding the OptionsBase.maxEntrySize

now?: number

The timestamp used for TTL calculation

oldValue?: V

The old value, specified in the case of set:'update' or set:'replace'

remainingTTL?: number

the remaining ttl for the item, or undefined if ttls are not used.

returnedStale?: true

A fetch or get operation returned a stale value.

set?: "add" | "update" | "replace" | "miss"

The status of a set() operation.

  • add: the item was not found in the cache, and was added
  • update: the item was in the cache, with the same value provided
  • replace: the item was in the cache, and replaced
  • miss: the item was not added to the cache for some reason
start?: number

the start time for the item, or undefined if ttls are not used.

totalCalculatedSize?: number

The total calculated size of the cache, if sizes are used.

ttl?: number

the ttl stored for the item, or undefined if ttls are not used.

Generated using TypeDoc