Skip to content

goBack

goBack is a DOM event that occurs whenever the user goes back in the menu view.

Event body

none

Example

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

useStorefront(async (storefront) => {
    document.addEventListener('goBack', () => {
        console.log('User went back in the menu');
    });
});