How to use popmotion-throttle - 1 common examples

To help you get started, we’ve selected a few popmotion-throttle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Popmotion / popmotion / packages / popmotion-on-screen / src / on-screen.js View on Github external
const init = () => {
    window.addEventListener('scroll', throttle(checkAll, 1000 / 30)); // 30fps
    window.addEventListener('resize', debounce(measureAll));

    trackViewport = true;
};

popmotion-throttle

Limit a function to firing no more than every `x` milliseconds, synced to the device framerate.

MIT
Latest version published 9 years ago

Package Health Score

56 / 100
Full package analysis

Popular popmotion-throttle functions