You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/3.0-major-release.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,33 @@ Version 3.0 of Feathers-Vuex is the Vue Composition API release! There were qui
16
16
17
17
And now it has become the best way to perform queries with Feathers-Vuex. To find out how to take advantage of the new functionality in your apps, read the [Feather-Vuex Composition API docs](./composition-api.md).
18
18
19
+
## New `extend` option for `makeServicePlugin` <Badgetext="3.9.0+" />
20
+
21
+
The `makeServicePlugin` now supports an `extend` method that allows customizing the store and gives access to the actual Vuex `store` object, as shown in this example:
22
+
23
+
```js
24
+
import { makeServicePlugin } from ‘feathers-vuex’
25
+
import { feathersClient } from ‘./feathers-client.js’
26
+
27
+
classTodo { /* truncated */ }
28
+
29
+
exportdefaultmakeServicePlugin({
30
+
Model: Todo,
31
+
service:feathersClient.service(‘todos’),
32
+
extend({ store, module }) {
33
+
// Listen to other parts of the store
34
+
store.watch(/* truncated */)
35
+
36
+
return {
37
+
state: {},
38
+
getters: {},
39
+
mutations: {},
40
+
actions: {}
41
+
}
42
+
}
43
+
})
44
+
```
45
+
19
46
## Partial data on patch <Badgetext="3.9.0+" />
20
47
As of version 3.9.0, you can provide an object as `params.data`, and Feathers-Vuex will use `params.data` as the patch data. This change was made to the service-module, itself, so it will work for `patch` across all of feathers-vuex. Here's an example of patching with partial data:
Copy file name to clipboardExpand all lines: docs/service-plugin.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -733,7 +733,36 @@ The `find` getter queries data from the local store using the same Feathers quer
733
733
734
734
## Customizing a Service's Default Store
735
735
736
-
As shown in the example below, the service module allows you to customize its store:
736
+
### New `extend` option for `makeServicePlugin` <Badgetext="3.14.0+" />
737
+
738
+
As of version `3.14.0`, the `makeServicePlugin` now supports an `extend` method that allows customizing the store and gives access to the actual Vuex `store` object, as shown in this example:
739
+
740
+
```js
741
+
import { makeServicePlugin } from ‘feathers-vuex’
742
+
import { feathersClient } from ‘./feathers-client.js’
743
+
744
+
classTodo { /* truncated */ }
745
+
746
+
exportdefaultmakeServicePlugin({
747
+
Model: Todo,
748
+
service:feathersClient.service(‘todos’),
749
+
extend({ store, module }) {
750
+
// Listen to other parts of the store
751
+
store.watch(/* truncated */)
752
+
753
+
return {
754
+
state: {},
755
+
getters: {},
756
+
mutations: {},
757
+
actions: {}
758
+
}
759
+
}
760
+
})
761
+
```
762
+
763
+
### Deprecated options for customizing the store
764
+
765
+
Before version `3.14.0`, you can customize the store using the options for `state`, `getters`, `mutations`, and `actions`, as shown below. This method is now deprecated and will be removed from Feathers-Vuex 4.0.
namespace: '',// The namespace for the Vuex module. Will generally be derived from the service.path, service.name, when available. Otherwise, it must be provided here, explicitly.
27
40
servicePath: '',
41
+
extend: ({ module })=>module,// for custom plugin (replaces state, getters, mutations, and actions)
28
42
state: {},// for custom state
29
43
getters: {},// for custom getters
30
44
mutations: {},// for custom mutations
@@ -91,7 +105,7 @@ export default function prepareMakeServicePlugin(
0 commit comments