Skip to content

Commit

Permalink
make trailing default to true
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Sep 21, 2023
1 parent 1e4684c commit 489b600
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useDebounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import lodashDebounce from 'lodash/debounce';
*/
export default function useDebounce(func, wait, options) {
const debouncedFnRef = useRef();
const {leading, maxWait, trailing} = options || {};
const {leading, maxWait, trailing = true} = options || {};

useEffect(() => {
const debouncedFn = lodashDebounce(func, wait, {leading, maxWait, trailing});
Expand Down

0 comments on commit 489b600

Please sign in to comment.