1 | import { useContext, useMemo } from 'react';
|
2 | import { ShopConfigContext } from '../components/ConfigProvider';
|
3 | import throwErrorInDev from '../helpers/throwErrorInDev';
|
4 | export 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 |