Last active
January 18, 2023 09:53
-
-
Save rony-arnac/71c7cdd6cd94c504292b223ae92800ba to your computer and use it in GitHub Desktop.
simple storage management that doesn't handle concurrent access
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 key = 'FORDEFI_data'; | |
async function storeComplexData (complexData: Record<string, string[]>) { | |
await chrome.storage.local.set({[key]: complexData}); | |
} | |
async function getComplexData () { | |
return (await chrome.storage.local.get([key]))?.[key]; | |
} | |
async function getComplexDataItem (complexDataKey: string) { | |
const complexData = await getComplexData(); | |
return complexData[complexDataKey]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment