Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Throttle<F>

Type parameters

  • F: Function

Hierarchy

  • WrappedTimingFunction<F>
    • Throttle

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Throttle<F>(fn: F, ms: number): Throttle<F>

Properties

canceled

canceled: boolean = false

Whether current timing function has been canceled.

fn

fn: Function

The original function.

ms

ms: number

Get or set the associated time interval in milliseconds.

wrapped

wrapped: F & { __original: F }

The wrapped function.

Methods

cancel

  • cancel(): boolean
  • Cancel throttle, function will be called without limit. Returns true if is not canceled before.

    Returns boolean

flush

  • flush(): true

reset

  • reset(): true
  • Reset throttle timeout, Will restart throttle timeout when next time calling fn and calls fn immediately.

    Returns true

Generated using TypeDoc