B
B
BonBon Slick2019-08-14 14:25:27
Vue.js
BonBon Slick, 2019-08-14 14:25:27

watch vs subscribe vs if?

https://vuex.vuejs.org/api/#watch
https://dev.to/viniciuskneves/watch-for-vuex-state...

1 - why watch the state when you can just apply or if you can output immediately 2 - :if="getSomeValueState"{{ stateGetterOfValue }}

mounted() {
            this.$store.watch(
does not work, why?
3 - what's the difference if you call watch: {on the main instance?
4 - this.$store.subscribeworks, but again, why and when to use it, because there is a watch

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question