I have a vuex repository with the following state:
state: { authed: false ,id: false }
Inside the component, I want to see the changes in authed state and send an AJAX call to the server. This must be done in the various components.
I tried using store.watch() , but it fires when the id or authed value changes. I also noticed that it differs from vm.$watch in that you cannot specify a property. When I tried to do this:
store.watch('authed',function(newValue,oldValue){
I got this error:
[vuex] store.watch only accepts a function.
Any help is appreciated!
source share