With enums/static variables are you referring to custom events or also DOM events? For custom-based events we use that approach but not for DOM events. If you do use it for DOM events, I'm curious to know more about it. Thank you!
With enums/static variables are you referring to custom events or also DOM events? For custom-based events we use that approach but not for DOM events. If you do use it for DOM events, I'm curious to know more about it. Thank you!
Why? This way you switch from “an event finds its deepest control” mentality to “anything at these coords receives it”, which may have much broader effect under different situations than any reasonable sense may suggest. Is there any programming benefit except pleasing some hacky techniques which go against the fundamental idea?
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.