I'm using Vue.js and Vuex.
I want to watch the value of store (I'll share my sample codes in the last of this post).
But I have encountered the error "Error: [vuex] store.watch only accepts a function."
In this Web site, I found how to use "single" store. https://codepen.io/CodinCat/pen/PpNvYr
However, in my case, I want to use "two" stores. Do you have any idea to solve this problem.
●index.js
'use strict';
import Vue from 'vue';
import Vuex from 'vuex';
import {test1Store} from './modules/test1.js';
import {test2Store} from './modules/test2.js';
Vue.use(Vuex);
export const store = new Vuex.Store({
    modules: {
        test1: test1Store,
        test2: tes21Store,
    }
});
●test1.js
'use strict';
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
export const checkerStore = {
    namespaced: true,
    state: {
        count: 1
    },
    getters: {
        getCount(state){
            return state.count;
        }
    }
};
export default {test1};
●test.vue
<template>
    {{ $store.state.couunt }}
</template>
<script>
    import {store} from './store/index.js';
    export default {
        data: function () {
            return {
            }
        },
        store: store,
        methods: {
        },
        mounted() {
            setInterval(() => { this.$store.state.count++ }, 1000);
            this.$store.watch(this.$store.getters['test1/getCount'], n => {
                console.log('watched: ', n)
                })
            }
        }
    }
</script>
 
    