Skip to content

Commit 4882cba

Browse files
committed
docs: updates
1 parent b9ef0fb commit 4882cba

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ Pinia Colada is an opinionated yet flexible data fetching layer on top of Pinia.
4646
npm install pinia @pinia/colada
4747
```
4848

49+
Install the plugins for the features you need:
50+
51+
```js
52+
import { createPinia } from 'pinia'
53+
import { QueryPlugin } from '@pinia/colada'
54+
55+
app.use(createPinia())
56+
// install after pinia
57+
app.use(QueryPlugin, {
58+
// optional options
59+
})
60+
```
61+
4962
## Usage
5063

5164
```vue
@@ -63,8 +76,8 @@ const { data: contact, isFetching } = useQuery({
6376
})
6477
6578
const { mutate: updateContact } = useMutation({
66-
// automatically invalidates the cache for ['contacts', id]
67-
keys: ({ id }) => ['contacts', id],
79+
// automatically invalidates the cache for ['contacts'] and ['contacts', id]
80+
keys: ({ id }) => [['contacts'], ['contacts', id]],
6881
mutation: _updateContact,
6982
})
7083
</script>

0 commit comments

Comments
 (0)