import { LocalCache } from '../models' ; param data export const buildRecordObject = < T > ( data ) => { return { data , lastChecked : Date . now ( ) , } as LocalCache . Record < T > ; } ; param record param timeout export const isRecordExpired = < T > ( record , timeout ) => { return Date . now ( ) > record . lastChecked + timeout * 60 * 1000 ; } ; param record param timeout export const isRecordUsable = < T > ( record , timeout ) => { return record . data !== undefined && ! isRecordExpired ( record , timeout ) ; } ;