Closed
Description
What problem does this feature solve?
One guy finded, that computed getter may use with arrow function and destructed variables/methods.
I went ahead, and appended this case to set()
, but failed, because setter not called component.
Later, i tried use arguments
: (locale => arguments[1].a.methods.updateLocale(locale))
, but vuex can't use dispatch
to this, because undefined.
I think this API looks nice and will reduce many new lines :D
What does the proposed API look like?
export default {
computed: {
...mapGetters(['global']),
locale: {
get: ({ global }) => global.locale,
set: (locale, { updateLocale }) => updateLocale(locale)
}
},
methods: {
...mapActions(['updateLocale'])
}
}
Metadata
Metadata
Assignees
Labels
No labels