Appearance
useProductWishlist
Definition
Manage wishlist for a single product.
Basic usage
ts
const {
isInWishlist,
removeFromWishlist,
addToWishlist
} = useProductWishlist(product);
Signature
ts
export function useProductWishlist(
product: Ref<Product>
): UseProductWishlistReturn
Parameters
Name | Type | Description |
---|---|---|
product | Ref<Product> |
Return type
See UseProductWishlistReturn
ts
export type UseProductWishlistReturn = {
/**
* Removes product from wishlist
*/
removeFromWishlist(): Promise<void>;
/**
* Adds product to wishlist
*/
addToWishlist(): Promise<void>;
/**
* Indicates whether a product is in wishlist
*/
isInWishlist: Ref<boolean>;
};
Properties
Name | Type | Description |
---|---|---|
isInWishlist | Ref<boolean> | Indicates whether a product is in wishlist |
Methods
Name | Type | Description |
---|---|---|
removeFromWishlist | Promise<void> | Removes product from wishlist |
addToWishlist | Promise<void> | Adds product to wishlist |