Interface Cache<K, V>

Any method that can store data and has .set(), .get() and .has() functions

interface Cache<K, V> {
    get(key: K): undefined | null | V;
    has(key: K): boolean;
    set(key: K, value: V): void;
    [key: string]: any;
}

Type Parameters

  • K
  • V

Indexable

  • [key: string]: any

Methods

Methods

  • Function used to get the song's data to the cache

    Parameters

    • key: K

    Returns undefined | null | V

  • Function to check if the cache has the song's data

    Parameters

    • key: K

    Returns boolean

  • Function used to set the song's data to the cache

    Parameters

    • key: K
    • value: V

    Returns void