3 ms·
You can use the `htmx:beforeSwap` event to transform responses if you'd like: <button hx-get="/example" hx-on="htmx:beforeSwap: event.detail.server
by recursivedoubts 4y ago
You can use the `htmx:beforeSwap` event to transform responses if you'd like:
<button hx-get="/example"
hx-on="htmx:beforeSwap: event.detail.serverResponse = transformResponse(event.detail.serverResponse)">
Example
</button>
In general, htmx is going to lean on events for integrating scripting into the hypermedia flow.