This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const browserDatabase = { | |
/** | |
* Loads data from browser storage | |
*/ | |
getItem<T>(location: string): T | null { | |
try { | |
const entryObject = JSON.parse(localStorage.getItem(location) || ''); | |
const { data, expiration, createdAt } = entryObject; | |
const MILLISECONDS_TO_SECONDS = 1000; |