Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked.
The function to be debounced.
Rest
The number of milliseconds to delay.
const debounced = debounce(() => console.log('debounced'), 100)debounced() // will be called after 100ms Copy
const debounced = debounce(() => console.log('debounced'), 100)debounced() // will be called after 100ms
Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked.