MCPcopy
hub / github.com/orestbida/cookieconsent / getState

Function getState

playground/src/modules/stateManager.js:40–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 * @returns {typeof defaultState} State
39 */
40export const getState = () => {
41 const savedState = localStorage.getItem(DEMO_ITEM_NAME);
42
43 if (savedState) {
44 try {
45 return JSON.parse(savedState);
46 } catch (e) {
47 //invalid state
48 }
49 }
50
51 return deepCopy(defaultState);
52};
53
54/**
55 * Erase cookies

Callers 15

updateGuiOptionsStateFunction · 0.90
index.jsFile · 0.90
translations.jsFile · 0.90
enabledTranslationFunction · 0.90
updateEditorFunction · 0.90
updateEditorFieldsFunction · 0.90
language.jsFile · 0.90
updateDetectedLanguageFunction · 0.90
updateCurrentLanguageFunction · 0.90

Calls 1

deepCopyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…