11 lines
309 B
JavaScript
11 lines
309 B
JavaScript
|
var Storage = {
|
||
|
set: function(category, key, value) {
|
||
|
window.localStorage.setItem(category +'-'+ key, JSON.stringify(value));
|
||
|
},
|
||
|
|
||
|
get: function(category, key) {
|
||
|
var val = window.localStorage.getItem(category +'-'+ key);
|
||
|
return val === null ? {} : JSON.parse(val);
|
||
|
}
|
||
|
};
|