revamp template

This commit is contained in:
fro1991
2025-02-01 16:44:51 +07:00
parent c432df568a
commit 276a289580
1212 changed files with 112762 additions and 0 deletions

21
src/utils/LocalStorage.ts Normal file
View File

@ -0,0 +1,21 @@
const getData = (key: string): unknown | undefined => {
try {
const data = localStorage.getItem(key);
if (data) {
return JSON.parse(data);
}
} catch (error) {
console.error('Read from local storage', error);
}
};
const setData = (key: string, value: unknown): void => {
try {
localStorage.setItem(key, JSON.stringify(value));
} catch (error) {
console.error('Save in local storage', error);
}
};
export { getData, setData };