Steady.js – A Module to Do Logic for onScroll Event
Steady.js is a jank-free module to do logic on the onscroll event without performance regressions in @media-query like conditions. First, Steady attaches a handler to the onscroll event, that excutes the trackers. Then it calls another function that checks the conditions with values inside a requestAnimationFrame to avoid making the onscroll handler fat and slow, which will jank our scrolling.
After that check, the function tries to see if the conditions are met. If they’re met, it calls the handler with the values and the done function, otherwise it does nothing. When the handler is called, Steady stops collecting values until the done callback is called by the handler. This will help you when you do async stuff.
License: MIT License