mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 23:57:07 +00:00
19 lines
No EOL
386 B
JavaScript
19 lines
No EOL
386 B
JavaScript
const storage = {
|
|
getItem(key) {
|
|
return new Promise(resolve => {
|
|
resolve(JSON.parse(localStorage.getItem(key)))
|
|
})
|
|
},
|
|
|
|
setItem(key, value) {
|
|
return new Promise(resolve => {
|
|
resolve(localStorage.setItem(key, JSON.stringify(value)))
|
|
})
|
|
},
|
|
|
|
removeItem(key) {
|
|
return new Promise(resolve => {
|
|
resolve(localStorage.removeItem(key))
|
|
})
|
|
}
|
|
} |