Optimize preference store

This commit is contained in:
Phan An 2017-05-06 09:11:06 +07:00
parent d83ee5e012
commit 84e9ba269e
No known key found for this signature in database
GPG key ID: 4AF3D4E287BF423F

View file

@ -43,11 +43,8 @@ export const preferenceStore = {
setupProxy () {
each(Object.keys(this.state), key => {
Object.defineProperty(this, key, {
get: () => this.state[key],
set: value => {
this.state[key] = value
this.save()
},
get: () => this.get(key),
set: value => this.set(key, value),
configurable: true
})
})