Use fire() instead of dispatch()
Addresses Copilot's feedback
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user