Options
All
  • Public
  • Public/Protected
  • All
Menu

Module modules/throttle

Functions

Functions

Const throttle

  • throttle(fn: function, wait: number): (Anonymous function)
  • 创建并返回一个像节流阀一样的函数,当重复调用函数的时候,最多每隔 wait毫秒调用一次该函数。对于想控制一些触发频率较高的事件有帮助。

    Parameters

    • fn: function

      传入回调函数

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • wait: number

      延时时间戳

    Returns (Anonymous function)

Generated using TypeDoc