Call an action from within another action Call an action from within another action vue.js vue.js

Call an action from within another action


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.


You can access the dispatch method through the first argument (context):

export const actions = {  get({ commit, dispatch }) {    dispatch('action2')  }}