Consider this scenario:
computed: {
greeting() {
const state = this.$store.state;
if (state.name === 'Joe') {
return 'Hey, Joe';
} else {
return 'Hello, ' + state.name;
}
}
}
Which object(s) will Vue observe changes on? Is it this.$store.state
, state.name
, or both? This question arises because:
- I need to ensure that this particular Vue instance is not constantly listening for all updates in the Vuex store as it could impact performance especially in a large application.
- I have a requirement to make certain computed properties reactive through props but I am facing challenges in achieving this.
- Simply out of curiosity, I seek an understanding.