Class MemoryMapCache<Records>

Cache implementation that uses a Map to store the data.

Type Parameters

  • Records extends Record<string, Some | null> = Record<string, Some>

Hierarchy

Implements

Constructors

Properties

cache: Map<keyof Records, Records[keyof Records]> = ...

Methods

  • Checks whether the cache has a value for the specified key.

    Type Parameters

    • Key extends string | number | symbol

      The type of the record key.

    Parameters

    • key: Key

      The record key.

    Returns boolean

    Whether the cache has a value for the specified key.

  • Reads a value from the cache.

    Type Parameters

    • Key extends string | number | symbol

      The type of the record key.

    Parameters

    • key: Key

      The record key.

    Returns undefined | Records[Key]

    The record value or undefined if the record does not exist.

  • Saves a value to the cache.

    Type Parameters

    • Key extends string | number | symbol

      The type of the record key.

    Parameters

    • key: Key

      The record key.

    • value: Records[Key]

      The record value.

    Returns void

Generated using TypeDoc