-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Add some sample files so linting can be tested"
This reverts commit 173af2a.
- Loading branch information
Showing
4 changed files
with
39 additions
and
60 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import localforage from 'localforage'; | ||
|
||
export async function getStorageItem(key) { | ||
try { | ||
const serializedData = await localforage.getItem(key); | ||
if (serializedData === null) { | ||
return undefined; | ||
} | ||
|
||
return JSON.parse(serializedData); | ||
} catch (err) { | ||
return undefined; | ||
} | ||
} | ||
|
||
export async function setStorageItem(key, value) { | ||
try { | ||
const serializedData = JSON.stringify(value); | ||
await localforage.setItem(key, serializedData); | ||
} catch (err) { | ||
console.warn(err); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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