Class WeakCache<K, V>

Type Parameters

  • K = any
  • V extends WeakKey = WeakKey

Constructors

Accessors

Methods

Constructors

Accessors

Methods

  • Removes the specified element from the WeakMap.

    Parameters

    • key: K

    Returns boolean

    true if the element was successfully removed, or false if it was not present.

  • Parameters

    • key: K

    Returns undefined | V

    a specified element.

  • Parameters

    • key: K

    Returns boolean

    a boolean indicating whether an element with the specified key exists or not.

  • Adds a new element with a specified key and value.

    Parameters

    • key: K

      Must be an object or symbol.

    • value: V

    Returns this