52fe56ec87
* adds prefer-const to eslint config and runs fixer * reverts unintended change
21 lines
288 B
JavaScript
21 lines
288 B
JavaScript
const cache = {};
|
|
|
|
export default {
|
|
getItem(key) {
|
|
var item = cache[key];
|
|
return item && JSON.parse(item);
|
|
},
|
|
|
|
setItem(key, val) {
|
|
cache[key] = JSON.stringify(val);
|
|
},
|
|
|
|
removeItem(key) {
|
|
delete cache[key];
|
|
},
|
|
|
|
keys() {
|
|
return Object.keys(cache);
|
|
},
|
|
};
|