Answers for "vuejs can you call action from anothter action"

9

vuex call action from another action

actions:{ 
  get1: ({ commit, dispatch }) => {
    dispatch('get2');
  },
  get2: ({commit}) => {
    //things
  },
}
Posted by: Guest on June-13-2020
0

vue store use action in action

actions: {
  actionA ({ commit }) {
    ...
  },
  actionB ({ dispatch, commit }) {
    return dispatch('actionA').then(() => {
      commit('someOtherMutation')
    })
  },
}
Posted by: Guest on July-06-2021

Code answers related to "vuejs can you call action from anothter action"

Browse Popular Code Answers by Language