util-lib-throttle

Throttle method of encapsulation integration

Usage no npm install needed!

<script type="module">
  import utilLibThrottle from 'https://cdn.skypack.dev/util-lib-throttle';
</script>

README

util-lib-throttle

Throttle method of encapsulation integration

Usage


    const utils = require('util-lib-throttle');

    // 绑定滚动事件
    window.addEventListener('scroll', utils.throttle(function (e) {
        console.log(11);
    }, 2000))