mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
working typescript version
This commit is contained in:
1 parent
581d6011e0
commit
cff746aa38
119 files changed
+247
-189
No files matched your search
@@ -2,17 +2,17 @@ import Default from "../default.json";
|
||||
import { atom, useRecoilState } from "recoil";
|
||||
|
||||
const configState = atom({
|
||||
key: 'config',
|
||||
default: Default
|
||||
})
|
||||
key: "config",
|
||||
default: Default,
|
||||
});
|
||||
|
||||
export const useConfig = (state = configState) => {
|
||||
const [config, _setConfig] = useRecoilState(state)
|
||||
const [config, _setConfig] = useRecoilState(state);
|
||||
|
||||
const setConfig = (key, value) => {
|
||||
_setConfig(oldConfig => ({
|
||||
_setConfig((oldConfig) => ({
|
||||
...oldConfig,
|
||||
[key]: value
|
||||
[key]: value,
|
||||
}));
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user