@spoosh/plugin-refetch 0.1.4 → 0.1.6
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 +3 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Auto-refetch plugin for Spoosh - refetch on window focus and network reconnect.
|
|
4
4
|
|
|
5
|
-
**[Documentation](https://spoosh.dev/docs/plugins/refetch)** · **Requirements:** TypeScript >= 5.0 · **Peer Dependencies:** `@spoosh/core`
|
|
5
|
+
**[Documentation](https://spoosh.dev/docs/react/plugins/refetch)** · **Requirements:** TypeScript >= 5.0 · **Peer Dependencies:** `@spoosh/core`
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -24,10 +24,10 @@ const client = new Spoosh<ApiSchema, Error>("/api").use([
|
|
|
24
24
|
]);
|
|
25
25
|
|
|
26
26
|
// Uses plugin defaults
|
|
27
|
-
useRead((api) => api.
|
|
27
|
+
useRead((api) => api("posts").GET());
|
|
28
28
|
|
|
29
29
|
// Per-query override
|
|
30
|
-
useRead((api) => api.
|
|
30
|
+
useRead((api) => api("posts").GET(), {
|
|
31
31
|
refetchOnFocus: false, // Disable for this query
|
|
32
32
|
});
|
|
33
33
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -22,7 +22,7 @@ type RefetchWriteResult = object;
|
|
|
22
22
|
*
|
|
23
23
|
* @param config - Plugin configuration
|
|
24
24
|
*
|
|
25
|
-
* @see {@link https://spoosh.dev/docs/plugins/refetch | Refetch Plugin Documentation}
|
|
25
|
+
* @see {@link https://spoosh.dev/docs/react/plugins/refetch | Refetch Plugin Documentation}
|
|
26
26
|
*
|
|
27
27
|
* @returns Refetch plugin instance
|
|
28
28
|
*
|
|
@@ -37,7 +37,7 @@ type RefetchWriteResult = object;
|
|
|
37
37
|
* ]);
|
|
38
38
|
*
|
|
39
39
|
* // Per-query override
|
|
40
|
-
* useRead((api) => api.
|
|
40
|
+
* useRead((api) => api("posts").GET(), {
|
|
41
41
|
* refetchOnFocus: false,
|
|
42
42
|
* });
|
|
43
43
|
* ```
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ type RefetchWriteResult = object;
|
|
|
22
22
|
*
|
|
23
23
|
* @param config - Plugin configuration
|
|
24
24
|
*
|
|
25
|
-
* @see {@link https://spoosh.dev/docs/plugins/refetch | Refetch Plugin Documentation}
|
|
25
|
+
* @see {@link https://spoosh.dev/docs/react/plugins/refetch | Refetch Plugin Documentation}
|
|
26
26
|
*
|
|
27
27
|
* @returns Refetch plugin instance
|
|
28
28
|
*
|
|
@@ -37,7 +37,7 @@ type RefetchWriteResult = object;
|
|
|
37
37
|
* ]);
|
|
38
38
|
*
|
|
39
39
|
* // Per-query override
|
|
40
|
-
* useRead((api) => api.
|
|
40
|
+
* useRead((api) => api("posts").GET(), {
|
|
41
41
|
* refetchOnFocus: false,
|
|
42
42
|
* });
|
|
43
43
|
* ```
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-refetch",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Auto-refetch plugin for Spoosh - refetch on focus and reconnect",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/
|
|
8
|
+
"url": "git+https://github.com/spooshdev/spoosh.git",
|
|
9
9
|
"directory": "packages/plugin-refetch"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/
|
|
12
|
+
"url": "https://github.com/spooshdev/spoosh/issues"
|
|
13
13
|
},
|
|
14
|
-
"homepage": "https://spoosh.dev/react/
|
|
14
|
+
"homepage": "https://spoosh.dev/docs/react/plugins/refetch",
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@spoosh/core": ">=0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@spoosh/core": "0.
|
|
40
|
+
"@spoosh/core": "0.10.0",
|
|
41
41
|
"@spoosh/test-utils": "0.1.5"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|