Skip to content

Commit 1d923ad

Browse files
feat(api): add a reset function
1 parent 59d8e43 commit 1d923ad

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/lib/db/localStorage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
const PREFERENCES_KEY = "Preferences";
22
const USER_DATA_KEY = "UserData";
33

4+
export function deleteEverything() {
5+
localStorage.removeItem(PREFERENCES_KEY);
6+
localStorage.removeItem(USER_DATA_KEY);
7+
}
48
// Utility function to get data from a specific key in localStorage
59
const getStorageObject = (key: string): Record<string, unknown> => {
610
return JSON.parse(localStorage.getItem(key) || "{}");

0 commit comments

Comments
 (0)