minor changes in localStorage - nothing to see here

This commit is contained in:
Christopher committed 2021-01-07 21:17:44 +01:00
1 parent dddddc01f8
commit 07dc73f0cb
6 files changed
+38 -29

No files matched your search

+7 -4
View File
@@ -8,12 +8,15 @@ const configState = atom({
});
export const useConfig = (state: any = configState): any => {
const [, setVal] = useLocalStorage();
const [config] = useRecoilState(state);
const [, setVal] = useLocalStorage('');
const [config, _setConfig] = useRecoilState(state);
const setConfig = (key, value) => {
console.log(`setConfig: ${key} ${value}`);
setVal(key, value);
_setConfig((oldConfig) => ({
...oldConfig,
[key]: value,
}));
//setVal(key, value);
};
return [config, setConfig];