当前位置:网站首页>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>
边栏推荐
- Use of laravel verifier
- Selection (025) - what is the output of the following code?
- Bubble sort
- MySQL 表的增删查改
- websocket长链接压测
- Selection (029) - what is the output of the following code?
- [JS] - [tree] - learning notes
- Laravel scheduled task
- 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
- 点的螺旋距离
猜你喜欢
![[JS] - [string - application] - learning notes](/img/dc/f35979b094f04c0ee13b3354c7741d.png)
[JS] - [string - application] - learning notes

伪原创智能改写api百度-收录良好

Jetpack Compose 最新进展

Pseudo original intelligent rewriting API Baidu - good collection

安装IBM CPLEX学术版 academic edition | conda 安装 CPLEX
![[JS] - [array, stack, queue, linked list basics] - Notes](/img/c6/a1bd3b8ef6476d7d549abcb442949a.png)
[JS] - [array, stack, queue, linked list basics] - Notes

【js】-【数组、栈、队列、链表基础】-笔记
![[JS] - [tree] - learning notes](/img/62/de4fa2a7c5e52c461b8be4a884a395.png)
[JS] - [tree] - learning notes

企业数据防泄露解决方案分享
![[JS] - [linked list - application] - learning notes](/img/e1/76d2a347b05212de349322f43e0b3a.png)
[JS] - [linked list - application] - learning notes
随机推荐
HarmonyOS访问数据库实例(3)--用ORM Bee测下HarmonyOS到底有多牛
Use of laravel verifier
Record the range of data that MySQL update will lock
R language uses the aggregate function of epidisplay package to split numerical variables into different subsets based on factor variables, calculate the summary statistics of each subset, and customi
Selection (028) - what is the output of the following code?
【js】-【树】-学习笔记
Selective sort method
Latest development of jetpack compose
R language dplyr package group_ By function and summarize_ The at function calculates the dataframe to calculate the number of counts and the mean value of different groups (summary data by category v
7-5 最大子矩阵和问题
Main cause of EMI - mold current
[JS] - [linked list - application] - learning notes
UNION ALL UNION FULL JOIN
R语言使用nnet包的multinom函数构建无序多分类logistic回归模型、使用exp函数和coef函数获取模型中每个变量(自变量改变一个单位)对应的优势比(odds ratio)
Jetpack Compose 最新进展
Listen to the markdown file and hot update next JS page
golang map clear
379. hide and seek
第六章 网络学习相关技巧5(超参数验证)
378. 骑士放置