Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EsMapCacheBackend<Key, Value, Entry>

Backend which uses as underlying storage EcmaScript 6 Map. It can be seen as a simple proxy over Map. Each operation is forwarded to underlying Map instance.

Type parameters

  • Key

    Type of the key.

  • Value

    Type of the value.

  • Entry: CacheEntry<Key, Value>

    Type of the cache entry.
    Defaults to CacheEntry.

Hierarchy

  • EsMapCacheBackend

Implements

Constructors

Accessors

Methods

Constructors

constructor

Accessors

size

  • get size(): number

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<[Key, Entry]>

clear

  • clear(): void

del

  • del(entry: Entry): void
  • Delete entry.

    Parameters

    • entry: Entry

      Entry that needs to be deleted.

    Returns void

get

  • get(key: Key): Undefinable<Entry>
  • Get the CacheEntry associated with key.

    Parameters

    • key: Key

      Name of the key.

    Returns Undefinable<Entry>

has

  • has(key: Key): boolean
  • Check if key is present in the cache.

    Parameters

    • key: Key

      Name of the key.

    Returns boolean

keys

  • keys(): IterableIterator<Key>
  • Returns an iterable of stored keys.

    Returns IterableIterator<Key>

set

  • set(key: Key, value: Value): Entry
  • Store key with value.

                            ⚠️ WARNING ⚠️
    

    This method should not be used to overwrite value of the key!
    You need to query the entry first and update value on the entry object.

    Parameters

    • key: Key

      Name of the key.

    • value: Value

      Value associated with key.

    Returns Entry

values

  • values(): IterableIterator<Entry>
  • Returns an iterable of stored values.

    Returns IterableIterator<Entry>