()
| 38 | * @returns {typeof defaultState} State |
| 39 | */ |
| 40 | export 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 |
no test coverage detected
searching dependent graphs…