Use Debounce Versions Save

A debounce hook for react

10.0.0

5 months ago
  • ❗️ [Major breaking change] replaced index.modern.js with index.mjs. Might require a little change in your build pipeline
  • ❗️ [Major breaking change] New option debounceOnServer: if you put the option to true, it will run debouncing on server (via setTimeout). The new option can break your current server behaviour, as v9.x, it runs all the time and might cause unnessesary server CPU utilisation. Now, by default, debounced callbacks do not happen on server.
  • ❕[Minor breaking change]: Replaced useState for useDebounce with useReducer. It might lead to reduced amount of re-renders, as useState is known to have excess re-renders in some corner: https://stackoverflow.com/questions/57652176/react-hooks-usestate-setvalue-still-rerender-one-more-time-when-value-is-equal
  • ❕[Minor breaking change]: useDebouncedCallback now updates function to call asap. Meaning, if you re-called the hook and it should trigger immediately, it will trigger the newest function all the time.
  • ℹ Lib size:
    • 914 B: index.js.gz
    • 851 B: index.js.br
    • 883 B: index.mjs.gz
    • 826 B: index.mjs.br
    • 938 B: index.module.js.gz
    • 873 B: index.module.js.br
    • 989 B: index.umd.js.gz
    • 919 B: index.umd.js.br
  • ℹ [Internal] Replaced Enzyme with testing-library
  • ℹ [Internal] yarn classic => npm
  • ℹ [Internal] Updated devDependencies

9.0.4

1 year ago

9.0.3

1 year ago
  • Represent correct return type from useDebounce(), see issue, thanks to @appden

9.0.1

1 year ago

Fix the bug with the incorrect import path. Now it's index.cjs, instead of index.js

9.0.0

1 year ago
  • Moved use-debounce to support modules see issue Thank to @matewilk
  • breaking change The path to dist/index.js is changed. Now it's dist/index.cjs.

8.0.4

1 year ago

8.0.3

1 year ago

8.0.2

1 year ago

8.0.1

1 year ago

Added jest@28 support

8.0.0

1 year ago
  • breaking change useDebounce changed its build system to microbundle. For now we have several entries:

index.js is for commonJS approach index.modern.js for esnext module system index.umd.js for UMD. All the files are in dist folder.

If you have any paths which have esm or lib, please, replace them to dist:

Before:

import useDebounceCallback from 'use-debounce/lib/useDebounceCallback'

After:

import { useDebounceCallback } from 'use-debounce';