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

18 lines
277 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-28 13:38:14 +00:00
const 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);
},
};