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

Function putState

src/utils/localStorage.ts:36–57  ·  view source on GitHub ↗
(
  key: string = "state",
  subKey: string = "substate",
  moreState: any,
)

Source from the content-addressed store, hash-verified

34};
35
36export function putState(
37 key: string = "state",
38 subKey: string = "substate",
39 moreState: any,
40) {
41 const state = loadState(key);
42
43 const subState = {
44 [subKey]: moreState,
45 };
46
47 if (state) {
48 const accState = {
49 ...state,
50 ...subState,
51 };
52
53 return saveState(key, accState);
54 }
55
56 return saveState(key, subState);
57}
58
59export function clearState(key?) {
60 if (!key) {

Callers

nothing calls this directly

Calls 2

loadStateFunction · 0.85
saveStateFunction · 0.85

Tested by

no test coverage detected