Use fire() instead of dispatch()

Addresses Copilot's feedback
This commit is contained in:
Alexander Zaytsev
2026-03-10 11:45:37 +01:00
parent 46943dc8c0
commit c977d03692
2 changed files with 3 additions and 3 deletions
@@ -3,7 +3,7 @@ import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static values = { name: String }
dispatch() {
document.dispatchEvent(new CustomEvent(this.nameValue, { bubbles: true }))
fire() {
this.dispatch(this.nameValue, { target: document, prefix: false })
}
}