Answer the question
In order to leave comments, you need to log in
Can action be assigned as a closure to a variable for multiple call from .js?
import store from '@/store';
export default function (to, from, next) {
const updateUrl = store._actions[`namespace`];
updateUrl.dispatch(`namespace`, {mewUrl: 'California'});
const module = 'some_really_very_long_namespace_for_moduloe'
const action= 'some_really_very_long_namespace_for__action'
store._actions[module ].dispatch(action, {mewUrl: 'California'});
store._actions[module ].dispatch(action, {mewUrl: 'California'});
store._actions[module ].dispatch(action, {mewUrl: 'California'});
const store_action= store._actions[module ]
const action_namespace= 'some_really_very_long_namespace_for__action'
store_action.dispatch(action_namespace, {mewUrl: 'California'});
store_action.dispatch(action_namespace, {mewUrl: 'California'});
store_action.dispatch(action_namespace, {mewUrl: 'California'});
Answer the question
In order to leave comments, you need to log in
store.dispatch('module/item', data).then(() => console.log('first call'));
store.dispatch('module/item', data).then(() => console.log('second call'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question