{
);
};
-export {usePreset};
+export {usePreset, useGlobalValue, GlobalSetting, GlobalValue};
export const useGlobalContext = (globalKey) => {
const contextValue = useContext();
@@ -206,25 +213,6 @@ export const GetGlobal = ({globalKey, children}) => {
return children({value: global});
};
-export const GlobalInfo = ({globalKey, value, needReady, children}) => {
- const {global, setGlobal} = useGlobalContext(globalKey);
- const setGlobalHandler = useRefCallback(setGlobal);
- const prevValueRef = useRef(null);
- prevValueRef.current = global;
- useEffect(() => {
- if (isEqual(prevValueRef.current, value)) {
- return;
- }
- prevValueRef.current = value;
- setGlobalHandler(value);
- }, [value, setGlobalHandler]);
-
- if (needReady && !global) {
- return null;
- }
- return children({global, setGlobal});
-};
-
const Global = ({children, className, ...props}) => {
return ( {