@commandkit/cache 0.0.0-dev.20250608021238 → 0.0.0-dev.20250609020912
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 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -16,9 +16,7 @@ To use the `@commandkit/cache` plugin, you need to add it to your CommandKit app
|
|
|
16
16
|
import { cache } from '@commandkit/cache';
|
|
17
17
|
|
|
18
18
|
export default defineConfig({
|
|
19
|
-
plugins: [
|
|
20
|
-
cache(),
|
|
21
|
-
],
|
|
19
|
+
plugins: [cache()],
|
|
22
20
|
})
|
|
23
21
|
```
|
|
24
22
|
|
|
@@ -50,14 +48,10 @@ async function fetchDogs() {
|
|
|
50
48
|
Now the `fetchDogs` function will be cached for 1 hour. You can perform on-demand cache invalidation or revalidation using the `invalidate` and `revalidate` methods:
|
|
51
49
|
|
|
52
50
|
```ts
|
|
53
|
-
import {
|
|
51
|
+
import { revalidateTag } from '@commandkit/cache';
|
|
54
52
|
|
|
55
53
|
async function refreshCache() {
|
|
56
|
-
// invalidate the cache for the "dogs" tag. This will remove the cached data.
|
|
57
|
-
// calling the function again will fetch fresh data.
|
|
58
|
-
await invalidate('dogs');
|
|
59
|
-
|
|
60
54
|
// revalidate the cache for the "dogs" tag. This will fetch fresh data and update the cache.
|
|
61
|
-
await
|
|
55
|
+
await revalidateTag('dogs');
|
|
62
56
|
}
|
|
63
57
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commandkit/cache",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.20250609020912",
|
|
4
4
|
"description": "CommandKit plugin that provides caching apis",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/ms": "^2.0.0",
|
|
29
29
|
"typescript": "^5.7.3",
|
|
30
|
-
"commandkit": "1.0.0-dev.
|
|
31
|
-
"tsconfig": "0.0.0-dev.
|
|
30
|
+
"commandkit": "1.0.0-dev.20250609020912",
|
|
31
|
+
"tsconfig": "0.0.0-dev.20250609020912"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"ms": "^2.1.3",
|