- 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
fromuseDebouncedCallback
returns a value. In v3 it used to returnundefined
: