DEV Community

loading...

Discussion on: How to make a resizable panel control with Web Components

ndesmic profile image
ndesmic Author • Edited

I don't think there's much of a difference in readability. Say for example myHandler doesn't use this at all. Would you write this.onclick = e => myHandler(e) to make it clear the event was passed or just this.onclick = myHandler? My general intuition is to try to keep it consistent and I generally prefer to not inline handlers (at least in the final product anyway) as I find it starts to clutter up the event handler registrations. To note things that are handlers versus plain methods I usually do by name onClick onPointerMove etc. so hopefully it would be apparent it takes an event parameter. These might be areas where I might switch to decorators whenever they start landing.