PageManager.submitEnded¶
PageManager.submitEnded
is an event on the Event Bus that occurs whenever a Turbo.submit-end event is fired in a page. To read more about Turbo visit the Page Manager Api documentation
Event body¶
Visit a Turbo.submit-end event documentation page to get the information about the data available as the event body.
Example¶
In this example we listen to PageManager.submitEnded
event and perform an action whenever it's emitted.
useStorefront(async (storefront) => {
storefront.eventBus.on('PageManager.submitEnded', () => {
console.log('The submit action has ended');
});
});
Example¶
In this example we use a Message Storage API to retrieve an array of past PageManager.submitEnded
events.
useStorefront((storefront) => {
const messageStorageApi = storefront.getApiSync('messageStorageSystemApi');
const pastSubmitEndedEvents = messageStorageApi.getChannelMessages('PageManager.submitEnded');
if (pastSubmitEndedEvents.length > 0) {
pastSubmitEndedEvents.forEach(({ body: eventBody }) => {
console.log('perform action on every past event');
});
}
});