-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Milestone
Description
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.jsand other where wishlist is used likeHeader.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- dispatcheswishlist/loadclearWishlist()- dispatcheswishlist/clearaddToWishlist(product)- dispatcheswishlist/addItemwith produuct as payloadremoveFromWishlist(product)- dispatcheswishlist/removeItemwith product as payloadproductsInWishlist- computed property returning products in wishlist from vUEX STOREui/openWishlist()- dispatchesui/setWishlistwithtruepayloadui/closeWishlist()- dispatchesui/setWishlistwithfalsepayloadui/isWishlistOpen- computed property returningui/wishliststate