stutrek / scrollmonitor

A simple and fast API to monitor elements as you scroll
MIT License
3.3k stars 243 forks source link

Add passive events support #56

Closed marcoms closed 6 years ago

marcoms commented 7 years ago

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

I think would be good to expose this as an option to users of this lib.