yarn use-debounce 4.0.0

latest releases: 10.0.1, 10.0.0, 10.0.0-alpha...
3 years ago
  • breaking change: Support lodash style throttling options for trailing+maxWidth. Thanks to @tryggvigy
    Example:
useDebouncedCallback(callback, 300, {
  leading: true,
  trailing: false,
  maxWait: 300,
})

Where the trailing edge is turned off. Let's say the function is called twice in the first 300ms. Now debounced function to have been called once.

how to migrate: Please, check your traling: false params with maxWait option

  • breaking change: Now in case delay option is unset, it will be requestAnimationFrame delay

  • breaking change: Now debouncedCallback from useDebouncedCallback returns a value. In v3 it used to return undefined:

Don't miss a new use-debounce release

NewReleases is sending notifications on new releases.