File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,19 @@ Pinia Colada is an opinionated yet flexible data fetching layer on top of Pinia.
46
46
npm install pinia @pinia/colada
47
47
```
48
48
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
+
49
62
## Usage
50
63
51
64
``` vue
@@ -63,8 +76,8 @@ const { data: contact, isFetching } = useQuery({
63
76
})
64
77
65
78
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] ],
68
81
mutation: _updateContact,
69
82
})
70
83
</script>
You can’t perform that action at this time.
0 commit comments