3 ms·
in htmx 4 you are able to swap it on a per-trigger basis, so need to muck w/the global fetch function: <button hx-get="/foo" hx-on:htmx:config:request="ctx.
by recursivedoubts 1y ago
in htmx 4 you are able to swap it on a per-trigger basis, so need to muck w/the global fetch function:
<button hx-get="/foo" hx-on:htmx:config:request="ctx.fetch = myCustomFetch">
Do It
</button>
- logankeenan 1y agoOh that’ll be much nicer. Would myCustomFetch then need to return a Response? https://developer.mozilla.org/en-US/docs/Web/API/Response https://developer.mozilla.org/en-US/docs/Web/API/Response