koel/resources/assets/js/services/ls.js

18 lines
275 B
JavaScript
Raw Normal View History

2015-12-13 04:42:28 +00:00
import ls from 'local-storage';
export default {
get(key, defaultVal = null) {
2016-03-16 03:51:07 +00:00
let val = ls(key);
2015-12-13 04:42:28 +00:00
return val ? val : defaultVal;
},
set(key, val) {
return ls(key, val);
},
remove(key) {
return ls.remove(key);
},
};