Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CacheProvider

A cache provider.

Hierarchy

  • CacheProvider

Implemented by

Index

Methods

Methods

clear

  • Clears the cache.

    chainable

    Returns CacheProvider

    this

get

  • get<TValue, TDefault>(key: any, defaultValue?: TDefault): TValue | TDefault
  • Returns a value from the cache.

    Type parameters

    • TValue = any

    • TDefault = TValue

    Parameters

    • key: any

      The key of the value.

    • Optional defaultValue: TDefault

    Returns TValue | TDefault

    The value.

has

  • has(key: any): boolean
  • Checks if the cache contains a value.

    Parameters

    • key: any

      The key of the value.

    Returns boolean

    Contains value or not.

set

  • Sets a value for an object.

    chainable

    Type parameters

    • TValue

    Parameters

    • key: any

      The key of the value.

    • value: TValue

      The value to set.

    Returns CacheProvider

    this

unset

  • Sets a value for an object.

    chainable

    Parameters

    • name: string

      The name of the value.

    Returns CacheProvider

    this

Generated using TypeDoc