Describes a cache.

Hierarchy

  • ICache

Methods

Methods

  • Tries to get a value from cache.

    Returns

    The value or the default value.

    Type Parameters

    • T extends unknown = any

    Parameters

    • key: any

      The key.

    Returns undefined | T | PromiseLike<undefined | T>

  • Type Parameters

    • T extends unknown = any

    • TDefault extends unknown = T

    Parameters

    • key: any
    • defaultValue: TDefault

    Returns T | TDefault | PromiseLike<T | TDefault>

  • Tries to write a value to cache.

    Returns

    A value, that indicates if operation was successful or not.

    Parameters

    • key: any

      The key.

    • value: any

      The value to write.

    Returns boolean | PromiseLike<boolean>

Generated using TypeDoc