Enable vuex logging
This commit is contained in:
parent
e85cf0ea55
commit
6f7aa28d22
@ -1,4 +1,4 @@
|
||||
import { createStore } from 'vuex'
|
||||
import { createStore, createLogger } from 'vuex'
|
||||
import dashboard from './modules/dashboard'
|
||||
import { LOGIN, LOGIN_SUCCESS, LOGOUT, TITLE } from './mutation-types'
|
||||
|
||||
@ -80,17 +80,18 @@ const store = createStore({
|
||||
},
|
||||
modules: {
|
||||
dashboard
|
||||
}
|
||||
},
|
||||
plugins: [createLogger()]
|
||||
})
|
||||
|
||||
store.subscribe((mutation, state) => {
|
||||
store.subscribeAction({
|
||||
after(mutation, state) {
|
||||
switch(mutation.type){
|
||||
case "setCurrentBudget":
|
||||
store.dispatch("fetchBudget", mutation.payload.ID)
|
||||
break;
|
||||
return store.dispatch("fetchBudget", mutation.payload)
|
||||
case "setCurrentAccount":
|
||||
store.dispatch("fetchAccount", mutation.payload.ID)
|
||||
break;
|
||||
return store.dispatch("fetchAccount", mutation.payload)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user