Add passive events support
joeyhoer opened this issue · 2 comments
joeyhoer commented
By passing the passive: true option to the addEventListener call you can inform the browser that the callback won't preventDefault(). This has noticeable performance benefits -- see https://developers.google.com/web/updates/2016/06/passive-event-listeners
camwiegert commented
@joeyhoer Interesting idea. If I understand correctly, though, this optimization shouldn't affect scroll
events as they can't be preventDefault()
'd.
So, this would only affect our resize
and load
listeners. The load
listener shouldn't be much of a factor. Is it worth it to feature-detect this for resize
events if they're already throttled, then?
camwiegert commented
I'm going to close this for now. I'm open to reopening it if there's a good argument for it eventually.