imacrayon / alpine-ajax

An Alpine.js plugin for building server-powered frontends.
https://alpine-ajax.js.org
MIT License
666 stars 15 forks source link

Allow raw response text to be read from event listeners #106

Closed justisr closed 3 weeks ago

justisr commented 1 month ago

Because response.text() cannot be called twice, it's currently impossible to read the response body if the response wasn't in html which limits the functionality event listeners can provide.

This change simply stores the raw text we've read in the response object that we're providing event listeners, so that they have access to that data as well.