Hacker News new | ask | show | jobs
by recursivedoubts 227 days 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>
1 comments

Oh that’ll be much nicer. Would myCustomFetch then need to return a Response?

https://developer.mozilla.org/en-US/docs/Web/API/Response