Skip to content

Instantly share code, notes, and snippets.

View fxmaxvl's full-sized avatar

maks.sadowsky fxmaxvl

  • WIX
  • Ukraine, Kyiv
View GitHub Profile
import { createActionHelpers } from 'vuex-loading';
const helpers = createActionHelpers({ moduleName: 'loading' });
helpers.mapActions = actions => {
for (let [action, handler] of Object.entries(actions)) {
actions[action] = (ctx, ...rest) => {
ctx.$loading = {
startLoading: actionName => helpers.startLoading(ctx.dispatch, actionName || action),
endLoading: actionName => helpers.endLoading(ctx.dispatch, actionName || action),