# throttle

函数节流

概念:让一个函数不要执行得太频繁,减少一些过快的调用来节流

应用场景:

  • scroll/resize/mousemove 事件

正常监听: 共触发 0 次









































































































































































节流监听监听: 共触发 0 次

防抖监听监听: 共触发 0 次

基础用法
import { throttle } from '@hui-pro/utils';
throttle(func, wait, opts);

# API

参数 说明 类型 默认值 可选值
func 节流函数回调 Function - -
wait 节流时间间隔 Number(ms) 16(ms) -
opts.noStart 设置节流函数起始是否触发 Boolean false -
opts.noEnd 设置节流函数结束是否触发 Boolean false -