-
Notifications
You must be signed in to change notification settings - Fork 438
Add a convenientce method for dispatching DOM events inside a controller #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The |
|
This is great, @adammiribyan. Could you add some documentation for it as well? @timrosskamp Support is available in all evergreen browsers, so think we're good there. Although I suppose it'd be nice to document the constraint: https://caniuse.com/?search=CustomEvent |
|
It would also be nice to see this integrate with the new debug mode added in #354, to give some visibility of events firing whilst debugging. |
Co-authored-by: Marco Roth <[email protected]>
|
Would be nice to get some tests added for this too, if someone wants to start a PR around that. |
|
I look forward to this feature :) |
|
In terms of attribution, this implementation seems pretty similar to: https://github.com/stimulus-use/stimulus-use/blob/main/docs/use-dispatch.md I'm not sure which came first :) (#302 (comment)) EDIT: It looks like the |
I came across this method while reading through the javascript code of Hey, and have implemented it, along with the globally accessible
ApplicationController, into a couple of projects already.I'm only responsible for compiling this PR, credit goes to the folks behind Hey 💯
this.dispatchcall.Here's an simplified e-shop example: