useDebounce

React hook that delays invoking a function until after wait milliseconds have elapsed since the last time the debounced function was invoked.

hooks
Description of the SVG image Loading...

About

The third argument is the array of values that the debounce depends on, in the same manner as useEffect. The debounce timeout will start when one of the values changes.


  • fn: Function - function that will be called;
  • ms: number - delay in milliseconds;
  • deps: DependencyList - array of values that the debounce depends on, in the same manner as useEffect;
  • isReady: ()=>boolean|null - function returning current debounce state:
  • false - pending
  • true - called
  • null - cancelled
  • cancel: ()=>void - cancel the debounce

Installation

Run the following command:

npx ever-ui-clx@0.2.1 add demo-use-debounce
# └──> Hook coming soon.

Usage