Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseLRUCache<K, T>

An in-memory LRU cache

author

Thomas Minier

Type parameters

  • K

  • T

Hierarchy

  • BaseLRUCache

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new BaseLRUCache(maxSize: number, maxAge: number, length?: undefined | function, onDispose?: undefined | function): BaseLRUCache
  • Constructor

    Parameters

    • maxSize: number

      The maximum size of the cache

    • maxAge: number

      Maximum age in ms

    • Optional length: undefined | function

      Function that is used to calculate the length of stored items

    • Optional onDispose: undefined | function

      Function that is called on items when they are dropped from the cache

    Returns BaseLRUCache

Properties

Private _content

_content: LRU<K, T>

Methods

count

  • count(): number

delete

  • delete(key: K): void

get

  • get(key: K): T | null

has

  • has(key: K): boolean

put

  • put(key: K, item: T): void

Generated using TypeDoc