Rather than dispatching events from one element and having another element listen for it (passive), I am seeing a lot of success of querying for the element and calling a method on it directly (eager). Feels great to me and seems like maybe this is the way web development will be
-
-
This really has the best of both worlds. It avoids excess coupling, but still achieves the result of fewer things in the blackhole. Reminds me of iOS development and their delegate system.
-
Or other higher order function patterns.
-
I'm having a hard time picturing an example of what's being suggested. That's probably me being dense but I'd love to see a snippet.
-
With custom elements, class methods are directly on the element itself, so document.querySelector('some-element'); then call the method directly on it. This feels cleaner/simpler to understand in many cases vs subscribing to an event. Tighter coupling though.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.