@spoosh/plugin-debounce 0.1.0-beta.0 → 0.1.2
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.
- package/README.md +5 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -13,9 +13,13 @@ npm install @spoosh/plugin-debounce
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
+
import { Spoosh } from "@spoosh/core";
|
|
16
17
|
import { debouncePlugin } from "@spoosh/plugin-debounce";
|
|
17
18
|
|
|
18
|
-
const
|
|
19
|
+
const client = new Spoosh<ApiSchema, Error>("/api")
|
|
20
|
+
.use([
|
|
21
|
+
debouncePlugin(),
|
|
22
|
+
]);
|
|
19
23
|
|
|
20
24
|
// Wait 300ms after typing stops before fetching
|
|
21
25
|
const { data } = useRead(
|
package/dist/index.d.mts
CHANGED
|
@@ -43,7 +43,13 @@ declare module "@spoosh/core" {
|
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```ts
|
|
46
|
-
*
|
|
46
|
+
* import { Spoosh } from "@spoosh/core";
|
|
47
|
+
*
|
|
48
|
+
* const client = new Spoosh<ApiSchema, Error>("/api")
|
|
49
|
+
* .use([
|
|
50
|
+
* // ... other plugins
|
|
51
|
+
* debouncePlugin(),
|
|
52
|
+
* ]);
|
|
47
53
|
*
|
|
48
54
|
* // Debounce search by 300ms
|
|
49
55
|
* useRead((api) => api.search.$get({ query: { q: searchTerm } }), {
|
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,13 @@ declare module "@spoosh/core" {
|
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```ts
|
|
46
|
-
*
|
|
46
|
+
* import { Spoosh } from "@spoosh/core";
|
|
47
|
+
*
|
|
48
|
+
* const client = new Spoosh<ApiSchema, Error>("/api")
|
|
49
|
+
* .use([
|
|
50
|
+
* // ... other plugins
|
|
51
|
+
* debouncePlugin(),
|
|
52
|
+
* ]);
|
|
47
53
|
*
|
|
48
54
|
* // Debounce search by 300ms
|
|
49
55
|
* useRead((api) => api.search.$get({ query: { q: searchTerm } }), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-debounce",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Request debouncing plugin for Spoosh - waits for inactivity before fetching",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@spoosh/core": ">=0.
|
|
36
|
+
"@spoosh/core": ">=0.3.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@spoosh/core": "0.
|
|
40
|
-
"@spoosh/test-utils": "0.1.
|
|
39
|
+
"@spoosh/core": "0.3.0",
|
|
40
|
+
"@spoosh/test-utils": "0.1.3"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "tsup --watch",
|