News for hackers. Stuff that matters.
Re:Htmx Is Composable? by _heimdall on Wednesday January 17, 2024 @03:41PM (#39033154)
That's where looking at HTML as serialized state really helps. When a request changes the cart the server responds with chunks of HTML "state" for anything that changed.

In the shopping cart case, a user clicks Add to Cart and the server responds with an update for the button (maybe it has a success message) + new HTML for the cart item counter in your header. Sure that counter is technically UI, but the server is sending it because the state has changed and the client needs to patch in the update.

There are no comments on this comment yet.