Re:Why, oh why was this added?
by noduerme on Monday May 30, 2022 @10:54AM
(#31559659)
I should clarify that I still use jQuery in most apps, specifically for its namespaced, off-DOM event model. (I've got my own vanilla version that deals in abortcontrollers but jQuery is handy enough for other things that I end up using it anyway).
So with native events, I don't bother to write enums but I do namespace them and listen for them through the JQ event chain. With custom events I write the enums and listen for them through JQ on the component instance, without having to listen on window or make the component extend EventTarget.
tl;dr I only use custom or namespaced events and never run anything between components/controllers through the DOM's native event chain.
So with native events, I don't bother to write enums but I do namespace them and listen for them through the JQ event chain. With custom events I write the enums and listen for them through JQ on the component instance, without having to listen on window or make the component extend EventTarget.
tl;dr I only use custom or namespaced events and never run anything between components/controllers through the DOM's native event chain.