Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • Args: unknown[]

    Arguments array infered from passed function to cache

  • ResultType: unknown

    Value that is returned from operation, infered from passed function

Hierarchy

  • CacheOptions

Index

Properties

Properties

Optional cache

cache: Cache<ResultType>

Cache instance

default

new Map()

Optional keymaker

keymaker: undefined | ((...args: Args) => string | number)

Function used to calculate cache key

default

(...args) => JSON.stringify(args)

returns

returned value used as a cache key

Optional ttl

ttl: undefined | number

Time for how long cached value is valid in ms. Defaults to 1h

default

3600000