Skip to content

Commit f6e5951

Browse files
committed
docs: fix cache readme
1 parent d438f98 commit f6e5951

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

packages/cache/README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ To use the `@commandkit/cache` plugin, you need to add it to your CommandKit app
1616
import { cache } from '@commandkit/cache';
1717

1818
export default defineConfig({
19-
plugins: [
20-
cache(),
21-
],
19+
plugins: [cache()],
2220
})
2321
```
2422

@@ -50,14 +48,10 @@ async function fetchDogs() {
5048
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:
5149

5250
```ts
53-
import { invalidate, revalidate } from '@commandkit/cache';
51+
import { revalidateTag } from '@commandkit/cache';
5452

5553
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-
6054
// revalidate the cache for the "dogs" tag. This will fetch fresh data and update the cache.
61-
await revalidate('dogs');
55+
await revalidateTag('dogs');
6256
}
6357
```

0 commit comments

Comments
 (0)