Skip to content

addedToFavourites.removed

addedToFavourites.removed is an event on the Event Bus that occurs whenever the product is removed from favourites.

Event body

The addedToFavourites.removed body has a string type which represents the stock id of the removed product. It is optional so it might not exist.

Example

In this example we listen to addedToFavourites.removed event and perform an action whenever it's emitted.

useStorefront(async (storefront) => {
    storefront.eventBus.on('addedToFavourites.removed', ({ body: stockId }) => {
        console.log('Product has has been removed from favourites with this stockId:', stockId);
    });
});