useWishlist
Category:
Wishlist
Composable to manage wishlist
Types
ts
export function useWishlist(): UseWishlistReturn
ts
export type UseWishlistReturn = {
/**
* Merge products with wishlist between async (API) and sync (localstorage) wishlists
*/
mergeWishlistProducts(): void;
/**
* Get products list added to wishlist
*/
getWishlistProducts(query?: Schemas["Criteria"]): Promise<void>;
/**
* Clear wishlist
*/
clearWishlist(): void;
/**
* Wishlist items (Product IDs)
*/
items: ComputedRef<string[]>;
/**
* Current page number
*/
currentPage: ComputedRef<number>;
/**
* total pages count
*/
totalPagesCount: ComputedRef<number>;
/**
* total wishlist items count
*/
count: ComputedRef<number>;
/**
* Indicates if the wishlist can be synced
*/
canSyncWishlist: ComputedRef<boolean>;
};