descriptionMatcher.fullDescriptionRendered¶
descriptionMatcher.fullDescriptionRendered
is an event on the Event Bus that occurs whenever the product description is rendered.
Event body¶
none
Example¶
In this example we listen to descriptionMatcher.fullDescriptionRendered
event and perform an action whenever it's emitted.
useStorefront(async (storefront) => {
storefront.eventBus.on('descriptionMatcher.fullDescriptionRendered', () => {
console.log('A product description has been rendered');
});
});
Example¶
In this example we use a Message Storage API to retrieve an array of past descriptionMatcher.fullDescriptionRendered
events.
useStorefront((storefront) => {
const messageStorageApi = storefront.getApiSync('messageStorageSystemApi');
const pastFullDescriptionRenderedEvents = messageStorageApi.getChannelMessages('descriptionMatcher.fullDescriptionRendered');
if (pastFullDescriptionRenderedEvents.length > 0) {
pastFullDescriptionRenderedEvents.forEach(({ body: eventBody }) => {
console.log('perform action on every past event');
});
}
});