Re:Show HN: In-view.js – Get notified when DOM elements ente...
by angry-hacker on Saturday August 27, 2016 @10:41AM
(#12372533)
Won't this be a performance killer?
[ Parent
| on HN ]
Re:Show HN: In-view.js – Get notified when DOM elements ente...
by tanto on Saturday August 27, 2016 @10:43AM
(#12372539)
Depends on how you use it and on how much elements. I am not sure if this is even worth to be a library. Sometimes I am wondering why people want to use a lib for everything.
Re:Show HN: In-view.js – Get notified when DOM elements ente...
by bikamonki on Saturday August 27, 2016 @10:53AM
(#12372586)
I agree, many times a library isn't necessary. In backbone.js I solved this with an interval triggering a global event which sends current scroll pos to all listening views.
Re:Show HN: In-view.js – Get notified when DOM elements ente...
by joesb on Sunday August 28, 2016 @03:24AM
(#12375650)
If it's not my own code, it's worth being a library.
And I don't want to spend my time learning to write it correctly to handle all case and be performant.
Re:Show HN: In-view.js – Get notified when DOM elements ente...
by Heqx on Saturday August 27, 2016 @11:12AM
(#12372666)
Any time you're performing an operation on a scroll event, that is a risk. But this uses a single "scroll" event listener throttled to fire a maximum of every 100ms.
https://github.com/camwiegert/in-view/blob/master/src/in-vie...