use-debounce-hook-web 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +32 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,4 +5,35 @@ A lightweight, production-ready debounce hook for React applications. Designed t
5
5
  ## Install
6
6
  ```markdown
7
7
  npm i use-debounce-hook-web
8
- ```
8
+ ```
9
+
10
+
11
+ ```js
12
+ import { useDebounce } from 'use-debounce-hook-web';
13
+ import { useState } from 'react';
14
+
15
+ const SearchInput = () => {
16
+ const [value, setValue] = useState('');
17
+
18
+ const debouncedValue = useDebounce(value, 500);
19
+
20
+ return (
21
+ <input
22
+ value={value}
23
+ onChange={(e) => setValue(e.target.value)}
24
+ placeholder="Search..."
25
+ />
26
+ );
27
+ };
28
+
29
+ export default SearchInput;
30
+ ```
31
+
32
+
33
+ ## Options
34
+ | Property | Type | Description |
35
+ | -------- | ------- | ----------------------------------------- |
36
+ | value | any | The value to debounce |
37
+ | delay | number | Debounce delay in milliseconds |
38
+ | leading | boolean | Execute immediately on first trigger |
39
+ | maxWait | number | Maximum wait time before forced execution |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-debounce-hook-web",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "A simple and reusable debounce hook for React",
5
5
  "main": "src/index.js",
6
6
  "publishConfig": {