@epic-web/cachified
Version:
neat wrapper for various caches
15 lines (14 loc) • 465 B
TypeScript
import { CacheMetadata } from './common';
/**
* Check wether a cache entry is expired.
*
* @returns
* - `true` when the cache entry is expired
* - `false` when it's still valid
* - `"stale"` when it's within the stale period
*/
export declare function isExpired(metadata: CacheMetadata): boolean | 'stale';
/**
* @deprecated prefer using `isExpired` instead
*/
export declare function shouldRefresh(metadata: CacheMetadata): 'now' | 'stale' | false;