当前位置:网站首页>throttle-debounce.js:一个小型的防抖节流函数库
throttle-debounce.js:一个小型的防抖节流函数库
2022-06-24 19:44:00 【彭世瑜】
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
<!-- 引入throttle-debounce -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/umd/index.min.js"></script>
<script> const throttleFunc = throttleDebounce.throttle(1000, ()=>{
}); const debounceFunc = throttleDebounce.debounce(1000, ()=>{
}); </script>
边栏推荐
- Financial management [6]
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses exp function, confint function and coef function to obtain the confidence
- 379. hide and seek
- Super detailed cookie addition, deletion, modification and query
- 7-9 寻宝路线
- QT to place the form in the lower right corner of the desktop
- websocket长链接压测
- Daily practice (22): maximum sum of continuous subarrays
- Detailed explanation of online group chat and dating platform project (servlet implementation)
- 376. 機器任務
猜你喜欢

Dig deep into MySQL - resolve the non clustered index of MyISAM storage engine

斐波那契

Fibonacci

Chapter VI skills related to e-learning 5 (super parameter verification)

Concurrent shared model management
![[JS] - [array application] - learning notes](/img/8a/808fde0cc86e0ec5e1f5558ba196b4.png)
[JS] - [array application] - learning notes

Still using simpledateformat for time formatting? Be careful of project collapse

RT-thread使用rt-kprintf

【js】-【链表-应用】-学习笔记

Ganglia 的安装与部署
随机推荐
Financial management [3]
Selection (029) - what is the output of the following code?
QT to place the form in the lower right corner of the desktop
SimpleDateFormat 格式化和解析日期的具体类
7-5 最大子矩阵和问题
R语言使用nnet包的multinom函数构建无序多分类logistic回归模型、使用exp函数和coef函数获取模型中每个变量(自变量改变一个单位)对应的优势比(odds ratio)
UNION ALL UNION FULL JOIN
Use of laravel verifier
【js】-【栈、队-应用】-学习笔记
Construction equipment [5]
Common regular expressions
Selection (027) - what is the output of the following code?
Chapter VI skills related to e-learning 5 (super parameter verification)
Pseudo original intelligent rewriting API Baidu - good collection
Collation of Digital IC design experience (II)
Laravel authentication module auth
257. 关押罪犯
去处电脑桌面小箭头
Selection (028) - what is the output of the following code?
Paddledtx v1.0 has been released, and its security and flexibility have been comprehensively improved!