@spoosh/plugin-retry 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,11 +13,12 @@ npm install @spoosh/plugin-retry
13
13
  ## Usage
14
14
 
15
15
  ```typescript
16
+ import { Spoosh } from "@spoosh/core";
16
17
  import { retryPlugin } from "@spoosh/plugin-retry";
17
18
 
18
- const plugins = [
19
- retryPlugin({ retries: 3, retryDelay: 1000 }), // 3 retries with 1 second delay
20
- ] as const;
19
+ const client = new Spoosh<ApiSchema, Error>("/api").use([
20
+ retryPlugin({ retries: 3, retryDelay: 1000 }),
21
+ ]);
21
22
 
22
23
  // Per-query override
23
24
  useRead((api) => api.posts.$get(), { retries: 5, retryDelay: 2000 });
package/dist/index.d.mts CHANGED
@@ -33,7 +33,13 @@ type RetryWriteResult = object;
33
33
  *
34
34
  * @example
35
35
  * ```ts
36
- * const plugins = [retryPlugin({ retries: 3, retryDelay: 1000 })];
36
+ * import { Spoosh } from "@spoosh/core";
37
+ *
38
+ * const client = new Spoosh<ApiSchema, Error>("/api")
39
+ * .use([
40
+ * // ... other plugins
41
+ * retryPlugin({ retries: 3, retryDelay: 1000 }),
42
+ * ]);
37
43
  *
38
44
  * // Per-query override
39
45
  * useRead((api) => api.posts.$get(), {
package/dist/index.d.ts CHANGED
@@ -33,7 +33,13 @@ type RetryWriteResult = object;
33
33
  *
34
34
  * @example
35
35
  * ```ts
36
- * const plugins = [retryPlugin({ retries: 3, retryDelay: 1000 })];
36
+ * import { Spoosh } from "@spoosh/core";
37
+ *
38
+ * const client = new Spoosh<ApiSchema, Error>("/api")
39
+ * .use([
40
+ * // ... other plugins
41
+ * retryPlugin({ retries: 3, retryDelay: 1000 }),
42
+ * ]);
37
43
  *
38
44
  * // Per-query override
39
45
  * useRead((api) => api.posts.$get(), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-retry",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Automatic retry plugin for Spoosh with configurable attempts and delay",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,11 +33,11 @@
33
33
  }
34
34
  },
35
35
  "peerDependencies": {
36
- "@spoosh/core": ">=0.2.0"
36
+ "@spoosh/core": ">=0.4.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@spoosh/core": "0.2.0",
40
- "@spoosh/test-utils": "0.1.1"
39
+ "@spoosh/core": "0.4.0",
40
+ "@spoosh/test-utils": "0.1.4"
41
41
  },
42
42
  "scripts": {
43
43
  "dev": "tsup --watch",