Function
putState
(
key: string = "state",
subKey: string = "substate",
moreState: any,
)
Source from the content-addressed store, hash-verified
| 34 | }; |
| 35 | |
| 36 | export 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 | |
| 59 | export function clearState(key?) { |
| 60 | if (!key) { |
Callers
nothing calls this directly
Tested by
no test coverage detected