您当前的位置: 首页 > 

彭世瑜

暂无认证

  • 5浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

throttle-debounce.js:一个小型的防抖节流函数库

彭世瑜 发布时间:2022-06-24 14:25:37 ,浏览量:5

Throttle and debounce functions.

文档:

  • https://github.com/niksy/throttle-debounce
  • https://www.npmjs.com/package/throttle-debounce
  • https://www.jsdelivr.com/package/npm/throttle-debounce
Node.js

安装

npm install throttle-debounce --save

示例

import { throttle, debounce } from 'throttle-debounce';

// delay 100 or 250 
throttle(delay, callback, { noLeading=false, noTrailing=false, debounceMode })

debounce(delay, callback, { atBegin=false })

CDN





const throttleFunc = throttleDebounce.throttle(1000, ()=>{});

const debounceFunc = throttleDebounce.debounce(1000, ()=>{});
 
关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.0674s