当前位置:网站首页>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 [5]
- Fibonacci
- 7-3 最大子段和
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用summary函数获取模型汇总统计信息、解读模型系数交互作用及其显著性
- Notes for laravel model
- Huawei machine learning service speech recognition function enables applications to paint "sound" and color
- InnoDB, the storage engine of MySQL Architecture Principle_ Redo log and binlog
- Construction equipment [5]
- Financial management [3]
- 文件包含漏洞问题
猜你喜欢

宁德时代定增450亿:高瓴认购30亿 曾毓群仍控制23%股权

【js】-【數組、棧、隊列、鏈錶基礎】-筆記

Harmonyos accessing database instances (3) -- use ORM bee to test how good harmonyos is

文件包含漏洞问题
Mycms we media CMS V3.0, resource push optimization, new free template

【js】-【字符串-应用】- 学习笔记
![[JS] - [tree] - learning notes](/img/62/de4fa2a7c5e52c461b8be4a884a395.png)
[JS] - [tree] - learning notes

【UVM入门 ===> Episode_8 】~ Sequence 和 Sequencer、Sequence 层次化

华为机器学习服务语音识别功能,让应用绘“声”绘色

22map introduction and API
随机推荐
websocket学习
[JS] - [tree] - learning notes
数字IC设计经验整理(二)
Construction equipment [6]
Building Survey [2]
基本数据类型
Mousse shares listed on Shenzhen Stock Exchange: becoming popular by mattress and "foreign old man", with a market value of 22.4 billion yuan
378. 骑士放置
Chapter VI skills related to e-learning 5 (super parameter verification)
Construction equipment [5]
Dig deep into MySQL - resolve the clustered index / secondary index / federated index of InnoDB storage engine
宁德时代定增450亿:高瓴认购30亿 曾毓群仍控制23%股权
OpenSSL SSL_read: Connection was reset, errno 10054
7-5 最大子矩阵和问题
点的螺旋距离
22map introduction and API
Laravel add helper file
R语言使用epiDisplay包的aggregate函数将数值变量基于因子变量拆分为不同的子集,计算每个子集的汇总统计信息、自定义FUN参数为多个统计量函数名称的列表计算多个统计量
RT thread uses RT kprintf
记录一下MySql update会锁定哪些范围的数据