useDebouncedCallback

Create a function that runs only after it stops being called for the given time.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

The callback runs once, 400ms after the last click.

APIs

useDebouncedCallback

const useDebouncedCallback = <A extends unknown[]>(
  callback: (...args: A) => void,
  wait: number,
) => ((...args: A) => void) & { cancel: () => void }
Edit this page on GitHub