()
| 46 | |
| 47 | init(); |
| 48 | async function init() { |
| 49 | const cache = new Cache('stateContext', 14 * 24 * 60 * 60 * 1000); |
| 50 | if (await cache.hasValue()) { |
| 51 | const curContext = await cache.getValue(); |
| 52 | if (curContext.stateContext) setStateContext(curContext.stateContext); |
| 53 | if (curContext.typeContext) setTypeContext(curContext.typeContext); |
| 54 | } |
| 55 | watch([typeContext, stateContext], () => { |
| 56 | cache.setValue({ |
| 57 | stateContext: stateContext.value, |
| 58 | typeContext: typeContext.value, |
| 59 | }); |
| 60 | }); |
| 61 | } |
| 62 | |
| 63 | export function getUrlObj() { |
| 64 | return JSON.parse(localStore.getItem(STORAGE_KEY) || 'null'); |
no test coverage detected