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