Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataCache<T>

Type parameters

  • T

Hierarchy

  • DataCache

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

getter

getter: function

Type declaration

    • (_: any, params?: object): Promise<T> | Observable<T>
    • Parameters

      • _: any
      • Optional params: object
        • [index: string]: any

      Returns Promise<T> | Observable<T>

obj

obj: number

time

time: function | number

Methods

add

  • Adds an item to the Cached collection. If DataCache.time was specified, the item will expire after this time (in milliseconds), and will be deleted.

    Parameters

    • key: any
    • value: T

    Returns DataCache<T>

clear

  • clear(): void

clearGetters

  • clearGetters(): void

get

  • get(key: any, params?: object, getter?: function): Observable<T>
  • Gets a value from the cache collection. If getter is specified, uses it to get the data.

    Parameters

    • key: any
    • Optional params: object
      • [index: string]: any
    • Optional getter: function
        • (): Promise<T> | Observable<T>
        • Returns Promise<T> | Observable<T>

    Returns Observable<T>

remove

  • remove(key: any): T
  • Removes an item from the cache collection.

    Parameters

    • key: any

    Returns T

    The removed value, or null if none was removed

Generated using TypeDoc