Is there a more efficient way to pass router params into Vuex actions for a large form?
edit_sport_type({ rootState, state, commit }, event) {
const sportName = rootState.route.params.sportName <-------
const payload = {sportName, event} <-------
commit(types.EDIT_SPORT_TYPE, payload)
},
Instead of repeating the process for every action like above,
edit_sport_type({ state, commit, getters }, event) {
const payload = {sportName, getters.getSportName} <-------
commit(types.EDIT_SPORT_TYPE, payload)
},
And avoiding the tedious task of grabbing params from component props each time you dispatch.
Looking for a way to streamline this process across multiple actions or even within mutations themselves.