minimize the rest of the sharedcomputedobject
This commit is contained in:
parent
ac32997f8b
commit
947b73f870
|
@ -1,18 +1,10 @@
|
|||
import { defaultState as configDefaultState } from 'src/modules/config.js'
|
||||
|
||||
const SharedComputedObject = () => ({
|
||||
user () {
|
||||
return this.$store.state.users.currentUser
|
||||
},
|
||||
// Generating computed values for vuex properties
|
||||
...Object.keys(configDefaultState)
|
||||
.map(key => [key, {
|
||||
get () { return this.$store.getters.mergedConfig[key] },
|
||||
set (value) {
|
||||
this.$store.dispatch('setOption', { name: key, value })
|
||||
}
|
||||
}])
|
||||
.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {})
|
||||
expertLevel () {
|
||||
return this.$store.getters.mergedConfig.expertLevel > 0
|
||||
}
|
||||
})
|
||||
|
||||
export default SharedComputedObject
|
||||
|
|
Loading…
Reference in New Issue