Events
Create an event listener with useEventListener
to listen to various events fired in the storefront. Javascript API - Events
Available events:
addToCart
checkout
loadPage
updateCartLine
import { useEventListener } from "@instantcommerce/sdk";
const CustomBlock = () => {
useEventListener("loadPage", (e) => {
// do something
});
};