create AppConfig context
This commit is contained in:
parent
55ae4f2b6c
commit
4928e20eab
@ -8,8 +8,12 @@ export const useAppContext = () => useContext(AppContext);
|
||||
const AppContextProvider = ({ children }) => {
|
||||
const [config, setConfig] = useState(null);
|
||||
|
||||
const get = ({ configKey }) => {
|
||||
return config[configKey];
|
||||
const get = ({ configKey = null }) => {
|
||||
if (configKey) {
|
||||
return config[configKey];
|
||||
}
|
||||
|
||||
return config;
|
||||
};
|
||||
|
||||
const add = ({ configKey, value }) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user