debounce

function debounce(func: Function, delay: number): (...args: any[]) => void

Debouncing a function, delaying its execution until after a specified delay has passed since it was last invoked.

const debounced = Utils.debounce(() => console.log('Hello'), 5000);
debounced(); // Hello is logged after 5 seconds
Parameter
Type
Optional
Description

func

Function

The function to debounce

delay

number

The delay in milliseconds

Last updated