Skip to content

[ Wishlist ] Add Wishlist core module #1434

@filrak

Description

@filrak

We should move wishlist logic to Core API Wishlist Module (first create it ^^), use it inside core components and unit test core api modules ( read this if you don't know what core api modules are ). Basically this module will be extremely similar to Cart module which can be found in core/api/cart

What should be done

  • Logic from Wishlist core components (Wishlist.js, WishlistIcon.js and other where wishlist is used like Header.js) should be moved to core API modules.
  • This components should use this module mixins directly instead of duplicating the logic
  • Core Wishlist functionalities should be unit tested
  • Every exported modules should be properly commented for Intelisense (see Cart module as example)
  • Create docs file (see example https://github.com/DivanteLtd/vue-storefront/blob/master/doc/api-modules/cart.md)

Proposed functionalities (ofc I'm open to discussion if you have better ideas)

  • loadFromCache - dispatches wishlist/load
  • clearWishlist() - dispatches wishlist/clear
  • addToWishlist(product) - dispatches wishlist/addItem with produuct as payload
  • removeFromWishlist(product) - dispatches wishlist/removeItem with product as payload
  • productsInWishlist - computed property returning products in wishlist from vUEX STORE
  • ui/openWishlist() - dispatches ui/setWishlist with true payload
  • ui/closeWishlist() - dispatches ui/setWishlist with false payload
  • ui/isWishlistOpen - computed property returning ui/wishlist state

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions