9.0 Released! → Native ESM runtimes 🚀, Vite support ⚡️, multi-window apps and more...
Read Announcement
ts
function throttle(fn: Function, delay?: number): (...args: any[]) => void;

Defined in: utils/shared.ts

Creates a throttled function that only invokes the provided function at most once per specified delay

Parameters

ParameterTypeDescription
fnFunctionThe function to throttle
delay?numberThe number of milliseconds to delay

Returns

A new throttled function

(...args: any[]) => void