Cached Value

CachedValue

Utility class for caching stable data

Parameters

  • refreshData function that refresh and return the data
  • cacheMaxAge (number | undefined) time in millisecond to expire cache

getValue

Returns cached data if valid or request fresh data if cache is invalid

Parameters

  • params use this params to request data if cache is expired