Re:Show HN: Magic Grid – A simple JavaScript library for dyn...
by Eli_P on Monday December 24, 2018 @11:39AM
(#18752874)
Correct me if I'm wrong, but using window.addEventListener("resize", () => (), 200) is no good, you probably should consider window.requestAnimationFrame() and debouncing. Otherwise, your library will drain battery juice, despite it's really lightweight. Say, on Android, actions like typing into an input field, changing orientation, scrolling backward and triggering url bar appearing, all of them do trigger costly document reflow.
[ Parent
| on HN ]