In a Rails 6.1 application using @rails/ujs
(no jquery), I'm trying to intercept when ajax requests are fired and when they are completed.
I have added the following to my application.js
document.addEventListener("turbolinks:load", () => {
document.addEventListener("ajax:send", () => {
console.log('SEND')
})
document.addEventListener("ajax:complete", () => {
console.log('COMPLETE')
})
})
I correctly get SEND
when I fire them, but when they end I don't get the (expected) COMPLETE
.
Am I missing something here?