@spoosh/plugin-invalidation 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 -2
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -40,11 +40,14 @@ await trigger({ body: { title: "New Post" } });
|
|
|
40
40
|
## Usage
|
|
41
41
|
|
|
42
42
|
```typescript
|
|
43
|
+
import { Spoosh } from "@spoosh/core";
|
|
43
44
|
import { invalidationPlugin } from "@spoosh/plugin-invalidation";
|
|
44
45
|
|
|
45
|
-
const
|
|
46
|
+
const client = new Spoosh<ApiSchema, Error>("/api")
|
|
47
|
+
.use([
|
|
48
|
+
invalidationPlugin(),
|
|
49
|
+
]);
|
|
46
50
|
|
|
47
|
-
// Auto-invalidates all related queries after mutation (default)
|
|
48
51
|
const { trigger } = useWrite((api) => api.posts.$post);
|
|
49
52
|
await trigger({ body: { title: "New Post" } });
|
|
50
53
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -42,7 +42,12 @@ declare module "@spoosh/core" {
|
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* ```ts
|
|
45
|
-
*
|
|
45
|
+
* import { Spoosh } from "@spoosh/core";
|
|
46
|
+
*
|
|
47
|
+
* const client = new Spoosh<ApiSchema, Error>("/api")
|
|
48
|
+
* .use([
|
|
49
|
+
* invalidationPlugin({ autoInvalidate: "all" }),
|
|
50
|
+
* ]);
|
|
46
51
|
*
|
|
47
52
|
* // Per-mutation override
|
|
48
53
|
* trigger({
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,12 @@ declare module "@spoosh/core" {
|
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* ```ts
|
|
45
|
-
*
|
|
45
|
+
* import { Spoosh } from "@spoosh/core";
|
|
46
|
+
*
|
|
47
|
+
* const client = new Spoosh<ApiSchema, Error>("/api")
|
|
48
|
+
* .use([
|
|
49
|
+
* invalidationPlugin({ autoInvalidate: "all" }),
|
|
50
|
+
* ]);
|
|
46
51
|
*
|
|
47
52
|
* // Per-mutation override
|
|
48
53
|
* trigger({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spoosh/plugin-invalidation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Cache invalidation plugin for Spoosh - auto-invalidates after mutations",
|
|
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",
|