Call an action from within another action

后端 未结 5 730
一个人的身影
一个人的身影 2021-01-30 05:03

I have the following setup for my actions:

get1: ({commit}) => {
  //things
  this.get2(); //this is my question!
},
get         


        
5条回答
  •  执笔经年
    2021-01-30 05:34

    You have access to the dispatch method in the object passed in the first parameter:

    get1: ({ commit, dispatch }) => {
      dispatch('get2');
    },
    

    This is covered in the documentation.

提交回复
热议问题