Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Cache<K, T>

A cache is a vue that materializes data for latter re-use

author

Thomas Minier

Type parameters

  • K

  • T

Hierarchy

  • Cache

Implemented by

Index

Methods

Methods

count

  • count(): number

delete

  • delete(key: K): void

get

  • get(key: K): T | null
  • Access an item by its key. Each call to get() should be predated by a call to has(), to check if the item is in the cache.

    Parameters

    • key: K

      Item's key

    Returns T | null

    The item with the given key, or null if it was not found

has

  • has(key: K): boolean
  • Test if the cache contains an item with a given key

    Parameters

    • key: K

      Item's key

    Returns boolean

    True if the cache contains the item with the given key, False otherwise

put

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

Generated using TypeDoc