xtreme-ui
Version:
Collection of reusable components that can be used in web projects
20 lines (19 loc) • 376 B
JavaScript
import { localStore as r } from "../helper/domHelper.js";
const s = (o, e) => {
try {
const t = r?.getItem(o);
return t ? JSON.parse(t) : e ?? "";
} catch (t) {
return console.log(t), e ?? "";
}
}, n = (o, e) => {
try {
r?.setItem(o, JSON.stringify(e));
} catch (t) {
console.log(t);
}
};
export {
s as getLocalState,
n as setLocalState
};