MCPcopy Create free account
hub / github.com/LevelUpWeb3/app / loadState

Function loadState

src/utils/localStorage.ts:5–15  ·  view source on GitHub ↗
(item: string = "state")

Source from the content-addressed store, hash-verified

3export const removeItem = (key) => localStorage.removeItem(key);
4
5export const loadState = (item: string = "state") => {
6 try {
7 const serializedState = getItem(item);
8 if (serializedState === null) {
9 return undefined;
10 }
11 return JSON.parse(serializedState);
12 } catch (err) {
13 return undefined;
14 }
15};
16
17export const saveState = (key: string = "state", state: any) => {
18 try {

Callers 1

putStateFunction · 0.85

Calls 1

getItemFunction · 0.85

Tested by

no test coverage detected