Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ObjectCache<T>

A cache for objects.

Type parameters

  • T

Hierarchy

  • ObjectCache

Implemented by

Index

Methods

Methods

get

  • get<TValue, TDefault>(obj: T, name: string, defaultValue?: TDefault): TValue | TDefault
  • Returns a value from the cache.

    Type parameters

    • TValue

    • TDefault

    Parameters

    • obj: T

      The underlying object.

    • name: string

      The name of the value.

    • Optional defaultValue: TDefault

    Returns TValue | TDefault

    The value.

has

  • has(obj: T, name: string): boolean
  • Checks if the cache contains a value.

    Parameters

    • obj: T

      The underlying object.

    • name: string

      The name of the value.

    Returns boolean

    Contains value or not.

set

  • set<TValue>(obj: T, name: string, value: TValue): this
  • Sets a value for an object.

    Type parameters

    • TValue

    Parameters

    • obj: T

      The underlying object.

    • name: string

      The name of the value.

    • value: TValue

      The value to set.

    Returns this

Generated using TypeDoc