Appearance
useProductWishlist ​
Definition ​
Manage wishlist for a single product.
Basic usage ​
ts
const {
isInWishlist,
removeFromWishlist,
addToWishlist
} = useProductWishlist(productId);
Signature ​
ts
export function useProductWishlist(
productId: string,
): UseProductWishlistReturn
Parameters ​
Name | Type | Description |
---|---|---|
productId | string |
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 |