Centralize route generation to a single place

This commit is contained in:
dannyrb committed 2020-05-17 21:42:38 -04:00
1 parent eecdb62dda
commit a99badd011
15 files changed
+57 -34

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { useCallback, useState } from 'react';
/**
* Implements the state/methods defined in `appConfig.context`.
*/
export const useAppConfig = initialValue => {
const [config, setConfig] = useState(initialValue || {});
const setCurrentConfig = useCallback(updatedConfig => {
setConfig(updatedConfig);
}, []);
return {
config,
setCurrentConfig,
};
};