UNPKG
common-function-utils
Version:
latest (0.0.28)
0.0.28
0.0.26
0.0.25
web和node开发中常用的函数工具。
robint-liu.github.io/common-function-utils
robint-liu/common-function-utils
common-function-utils
/
types
/
throttle
/
index.d.ts
9 lines
(8 loc)
•
358 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
9
/** * 函数节流,即对函数进行特殊处理,使其在约定的时间段内避免函数过多次执行。 *
@param
fn 待处理的函数 *
@param
duration 函数防抖时长,单位为毫秒,默认为1000 *
@return
经过处理的fn *
@category
Throttle
*/
export
default
function
throttle
(
fn:
Function
, duration?: number
):
Function
;