fleet/frontend/utilities/local.js
2016-10-03 15:50:28 -04:00

24 lines
495 B
JavaScript

const { window } = global;
const local = {
clear: () => {
const { localStorage } = window;
localStorage.clear();
},
getItem: (itemName) => {
const { localStorage } = window;
return localStorage.getItem(`KOLIDE::${itemName}`);
},
setItem: (itemName, value) => {
const { localStorage } = window;
return localStorage.setItem(`KOLIDE::${itemName}`, value);
},
};
export const authToken = () => { return local.getItem('auth_token'); };
export default local;