@spoosh/plugin-refetch 0.1.1 → 0.1.3

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 CHANGED
@@ -13,14 +13,15 @@ npm install @spoosh/plugin-refetch
13
13
  ## Usage
14
14
 
15
15
  ```typescript
16
+ import { Spoosh } from "@spoosh/core";
16
17
  import { refetchPlugin } from "@spoosh/plugin-refetch";
17
18
 
18
- const plugins = [
19
+ const client = new Spoosh<ApiSchema, Error>("/api").use([
19
20
  refetchPlugin({
20
21
  refetchOnFocus: true,
21
22
  refetchOnReconnect: true,
22
23
  }),
23
- ] as const;
24
+ ]);
24
25
 
25
26
  // Uses plugin defaults
26
27
  useRead((api) => api.posts.$get());
package/dist/index.d.mts CHANGED
@@ -28,13 +28,17 @@ type RefetchWriteResult = object;
28
28
  *
29
29
  * @example
30
30
  * ```ts
31
- * const plugins = [
32
- * refetchPlugin({ refetchOnFocus: true, refetchOnReconnect: true }),
33
- * ];
31
+ * import { Spoosh } from "@spoosh/core";
32
+ *
33
+ * const client = new Spoosh<ApiSchema, Error>("/api")
34
+ * .use([
35
+ * // ... other plugins
36
+ * refetchPlugin({ refetchOnFocus: true, refetchOnReconnect: true }),
37
+ * ]);
34
38
  *
35
39
  * // Per-query override
36
40
  * useRead((api) => api.posts.$get(), {
37
- * refetchOnFocus: false, // Disable for this query
41
+ * refetchOnFocus: false,
38
42
  * });
39
43
  * ```
40
44
  */
package/dist/index.d.ts CHANGED
@@ -28,13 +28,17 @@ type RefetchWriteResult = object;
28
28
  *
29
29
  * @example
30
30
  * ```ts
31
- * const plugins = [
32
- * refetchPlugin({ refetchOnFocus: true, refetchOnReconnect: true }),
33
- * ];
31
+ * import { Spoosh } from "@spoosh/core";
32
+ *
33
+ * const client = new Spoosh<ApiSchema, Error>("/api")
34
+ * .use([
35
+ * // ... other plugins
36
+ * refetchPlugin({ refetchOnFocus: true, refetchOnReconnect: true }),
37
+ * ]);
34
38
  *
35
39
  * // Per-query override
36
40
  * useRead((api) => api.posts.$get(), {
37
- * refetchOnFocus: false, // Disable for this query
41
+ * refetchOnFocus: false,
38
42
  * });
39
43
  * ```
40
44
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-refetch",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Auto-refetch plugin for Spoosh - refetch on focus and reconnect",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,11 +34,11 @@
34
34
  }
35
35
  },
36
36
  "peerDependencies": {
37
- "@spoosh/core": ">=0.2.0"
37
+ "@spoosh/core": ">=0.4.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@spoosh/core": "0.2.0",
41
- "@spoosh/test-utils": "0.1.1"
40
+ "@spoosh/core": "0.4.0",
41
+ "@spoosh/test-utils": "0.1.4"
42
42
  },
43
43
  "scripts": {
44
44
  "dev": "tsup --watch",