Class Cache<T>

Type Parameters

  • T

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

cache: {
    [key: string]: Partial<T>;
}

Type declaration

  • [key: string]: Partial<T>
client: Client

The client that instantiated this class.

Methods

  • Updates a value in the cache, this is separate from set in the sense that it only updates the specified keys as to preserve the most information possible.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • key: string
    • data: Partial<Pick<T, K>>

    Returns void

  • Get a value from the cache.

    Parameters

    • key: string

    Returns Partial<T>

  • Check if a value exists in the cache.

    Parameters

    • key: string

    Returns boolean

  • Set a value in the cache.

    Parameters

    • key: string
    • value: Partial<T>

    Returns void

Generated using TypeDoc