I really hope I didnt fuck anything up now

This commit is contained in:
chip committed 2020-08-23 20:08:08 +02:00
1 parent ad20755608
commit ec37fcde46
67 files changed

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import Default from "../default.json";
import { atom, useRecoilState } from "recoil";
const configState = atom({
key: 'config',
default: Default
})
export const useConfig = (state = configState) => {
const [config, _setConfig] = useRecoilState(state)
const setConfig = (key, value) => {
_setConfig(oldConfig => ({
...oldConfig,
[key]: value
}));
};
return [config, setConfig];
};