UNPKG

463 BJavaScriptView Raw
1import { useContext, useMemo } from 'react';
2import { ShopConfigContext } from '../components/ConfigProvider';
3import throwErrorInDev from '../helpers/throwErrorInDev';
4export function useShopConfig() {
5 const config = useContext(ShopConfigContext);
6 if (!config) {
7 throwErrorInDev(true, 'Could not find ShopConfigContext. Is your shop.config.js valid?');
8 }
9 return useMemo(() => config, [config]);
10}
11//# sourceMappingURL=useShopConfig.js.map
\No newline at end of file