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
Closes#221
This adds the `handleEvents` properties, which let you fine-tune the event handling process per event.
```js
handleEvents: {
created(item, { model, models }) {
return true // truthy adds the record
},
patched(item, { model, models }) {
return true // truthy adds the record
},
updated(item, { model, models }) {
return true // truthy adds the record
},
removed(item, { model, models }) {
return true // truthy removes the record from the store
},
}
```
Thanks to @barata for the great idea!
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.
14
18
nameStyle: 'short',// Determines the source of the module name. 'short', 'path', or 'explicit'
15
19
servicePath: '',
20
+
handleEvents: {}asHandleEvents,
16
21
state: {},// for custom state
17
22
getters: {},// for custom getters
18
23
mutations: {},// for custom mutations
19
24
actions: {},// for custom actions
20
25
instanceDefaults: ()=>({}),// Default instanceDefaults returns an empty object
21
26
setupInstance: instance=>instance// Default setupInstance returns the instance
0 commit comments