CommonLimitFunction
Callable
Type parameters
- argsT: any[]
- retT
Parameters
func: (...args: argsT) => retT
The function to limit calls of
optionalminWait: number = 0
A lower bound for how long the wait interval can be, 0 by default
optionalmaxWait: number = 1000
An upper bound for how long the wait interval can be, 1 second by default
Returns (...args: argsT) => retT
- A debounced or throttled version of the function
Parameters
rest...args: argsT
Returns retT
Creates a wrapper for a function to limit how often it can be called. The player-defined wait interval setting determines the allowed frequency. Below 100 ms the function will be throttled and above will be debounced.