@spoosh/react 0.1.0-beta.0 → 0.1.1

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 +5 -8
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -15,18 +15,15 @@ npm install @spoosh/core @spoosh/react
15
15
  ### Setup
16
16
 
17
17
  ```typescript
18
- import { createSpoosh } from "@spoosh/core";
18
+ import { Spoosh } from "@spoosh/core";
19
19
  import { createReactSpoosh } from "@spoosh/react";
20
20
  import { cachePlugin } from "@spoosh/plugin-cache";
21
21
 
22
- const plugins = [cachePlugin({ staleTime: 5000 })];
22
+ const spoosh = new Spoosh<ApiSchema, Error>("/api").use([
23
+ cachePlugin({ staleTime: 5000 }),
24
+ ]);
23
25
 
24
- const client = createSpoosh<ApiSchema, Error, typeof plugins>({
25
- baseUrl: "/api",
26
- plugins,
27
- });
28
-
29
- export const { useRead, useWrite, useInfiniteRead } = createReactSpoosh(client);
26
+ export const { useRead, useWrite, useInfiniteRead } = createReactSpoosh(spoosh);
30
27
  ```
31
28
 
32
29
  ### useRead
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/react",
3
- "version": "0.1.0-beta.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "description": "React hooks for Spoosh API client",
6
6
  "keywords": [
@@ -8,8 +8,8 @@
8
8
  "react",
9
9
  "hooks",
10
10
  "api-client",
11
- "useQuery",
12
- "useMutation"
11
+ "useRead",
12
+ "useWrite"
13
13
  ],
14
14
  "repository": {
15
15
  "type": "git",
@@ -34,7 +34,7 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@spoosh/core": "0.1.0-beta.0"
37
+ "@spoosh/core": "0.2.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": "^18 || ^19"