Computed not updating when data changes


#23

@FEA5T I think what you’re missing is that you can use a watcher on a computed prop (using ES6 features for brevity):

computed: {
  compAddress() {
    return `${this.name} ${this.houseNumber} ${this.street} ${this.unit} ${this.city} ${this.state} ${this.zip} ${this.country}`
  }
},
watch: {
  compAddress() {
    this.validateAndSave()
  }
}

This is a much cleaner separation of concerns. Computed props are side-effect free, and the watcher does side-effects when the computed property changes.

Regarding lazy-evaluation, if you don’t consume your computed props, then it doesn’t matter if it changed or not, so no need to evaluate, thus, no need for a watcher.