koel/resources/assets/js/services/ls.js
2016-06-26 00:05:24 +08:00

17 lines
284 B
JavaScript

import localStore from 'local-storage';
export const ls = {
get(key, defaultVal = null) {
const val = localStore(key);
return val ? val : defaultVal;
},
set(key, val) {
return localStore(key, val);
},
remove(key) {
return localStore.remove(key);
},
};