arve0 / vue-persistent-state

Persist state to localstorage
https://www.npmjs.com/package/vue-persistent-state
11 stars 1 forks source link

watchers get triggered multiple times #4

Closed Gormartsen closed 6 years ago

Gormartsen commented 6 years ago

Global mixin with watchers will add watchers to each component. As a result any changes to this.$store.myvalue will trigger multiple (equal to the count of components) store.item.

I suggest to use this.$watch(name, function) on created with a global trigger if watchers has been added (usually to first component?)

arve0 commented 6 years ago

Thanks for reporting, and sorry for the late reply. I'll see if I find some time looking into this.

arve0 commented 6 years ago

Fixed in v0.2.0.