Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "project/HasCache"

Index

Interfaces

Functions

Functions

retrieveOrCompute

  • retrieveOrCompute<T, R>(t: T, key: string, how: (t: T) => R, cache?: boolean): Promise<R>
  • Retrieve the value if stored in the cache. Otherwise compute with the given function and store

    Type parameters

    Parameters

    • t: T
    • key: string
    • how: (t: T) => R
        • (t: T): R
        • Parameters

          • t: T

          Returns R

    • Default value cache: boolean = true

    Returns Promise<R>

Generated using TypeDoc