UNPKG

@shopify/shop-minis-react

Version:

React component library for Shopify Shop Minis with Tailwind CSS v4 support (source-only, requires TypeScript)

35 lines (29 loc) 860 B
import {useShopActions} from '../../internal/useShopActions' import {useShopActionsDataFetching} from '../../internal/useShopActionsDataFetching' import { DataHookOptionsBase, DataHookReturnsBase, BuyerAttributes, } from '../../types' export interface UseBuyerAttributesParams extends DataHookOptionsBase {} export interface UseBuyerAttributesReturns extends DataHookReturnsBase { buyerAttributes: BuyerAttributes | null } export const useBuyerAttributes = ( params?: UseBuyerAttributesParams ): UseBuyerAttributesReturns => { const {skip, ...shopActionParams} = params || {} const {getBuyerAttributes} = useShopActions() const {data, ...rest} = useShopActionsDataFetching( getBuyerAttributes, shopActionParams, { skip, hook: 'useBuyerAttributes', } ) return { ...rest, buyerAttributes: data, } }