Standard storefront events and actions
An app that wants to know when a buyer adds an item to the cart used to read your theme's DOM or intercept window.fetch, which meant a separate integration for every theme. Standard storefront events and actions give every theme and every app the same interface instead.
Your theme dispatches an event when a buyer does something, such as viewing a product or updating the cart. Apps call an action when they need your theme to change something, such as opening the cart.
Anchor to What your theme doesWhat your theme does
Actions run on every Liquid storefront without you setting anything up, because every action ships with a default implementation. An app can call updateCart on your theme today with no work from you.
Those defaults have to work on any theme, so updateCart falls back to a page reload when it can't recognize your cart markup. A reload throws away scroll position and anything the buyer had typed.
You can configure an action to update your own UI instead, and dispatch events from the places in your theme where buyers act.