Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by yawaramin on Friday May 09, 2025 @03:30PM
(#43940213)
Notification incrementing is not purely client-side state though. It's triggered by an event coming from a server. Eg let's say you're on a product page and you click 'Add to Cart'. You want the cart icon's counter badge on the top right corner of the page to increment. With eg htmx when you click 'Add to Cart' we send a request to the server, it updates the cart state in the backend, then sends an HTML fragment response that updates the necessary parts of the page, including the cart item counter badge.
[ Parent
| on HN ]
There are no comments on this comment yet.