1
0
Fork 0
empact/app/js/storage.js

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);
}
};