@shopify/shop-minis-react
Version:
React component library for Shopify Shop Minis with Tailwind CSS v4 support (source-only, requires TypeScript)
28 lines (23 loc) • 708 B
text/typescript
import {
FollowShopParams,
UnfollowShopParams,
} from '@shopify/shop-minis-platform/actions'
import {useHandleAction} from '../../internal/useHandleAction'
import {useShopActions} from '../../internal/useShopActions'
interface UseFollowedShopsActionsReturns {
/**
* Follows a shop.
*/
followShop: (params: FollowShopParams) => Promise<boolean>
/**
* Unfollows a shop.
*/
unfollowShop: (params: UnfollowShopParams) => Promise<boolean>
}
export const useFollowedShopsActions = (): UseFollowedShopsActionsReturns => {
const {followShop, unfollowShop} = useShopActions()
return {
followShop: useHandleAction(followShop),
unfollowShop: useHandleAction(unfollowShop),
}
}