Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • LruCache

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new LruCache(maxEntries?: number, evictCallback?: (t: T) => void): LruCache

Properties

Private Readonly evictCallback

evictCallback: (t: T) => void

Type declaration

    • (t: T): void
    • Parameters

      • t: T

      Returns void

Private gets

gets: number = 0

Private hits

hits: number = 0

Private Readonly maxEntries

maxEntries: number

Private Readonly values

values: Map<string, T> = new Map<string, T>()

Accessors

stats

  • get stats(): { gets: number; hits: number }

Methods

evict

  • evict(key: string): boolean

get

  • get(key: string): T

put

  • put(key: string, value: T): void

Generated using TypeDoc