How to use the raf.remove function in raf

To help you get started, we’ve selected a few raf 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 antoninlanglade / react-smooth-scroll / src / index.js View on Github external
stopScroll(bool) {
        this.isStopped = bool;
        bool ? RAF.remove(this.run) : RAF.add(this.run);
    }
github antoninlanglade / react-smooth-scroll / src / index.js View on Github external
remove(element) {
        var object = this.findElement(element);

        if (!object) {
            return;
        }

        object.virtual.off(this.onScroll.bind(this, element));
        object.virtual.destroy();

        _.remove(this.elements, function(item) {
            return item.el === element;
        });
        if (this.elements.length === 0) {
            this.isRunning = false;
            RAF.remove(this.run);
        }
    }

raf

requestAnimationFrame polyfill for node and the browser

MIT
Latest version published 6 years ago

Package Health Score

74 / 100
Full package analysis