How to use the vuex-pathify.make.actions function in vuex-pathify

To help you get started, we’ve selected a few vuex-pathify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github davestewart / vuex-pathify / demo / src / examples / api / vuex / helpers.js View on Github external
const mutations = {

  // creates SET_* functions
  ...make.mutations(state),

  // additional increment function
  INCREMENT_FOO (state) {
    state.foo++
  }
}

const actions = {

  // creates redundant actions, but for foo only
  ...make.actions('foo'),

  // additional loadFoo action
  loadFoo ({commit}) {
    return new Promise (function (resolve, reject) {
      setTimeout(function () {
        const value = Date.now()
        commit('SET_FOO', value)
        resolve(value)
      }, 1000)
    })
  }
}

export default {
  namespaced: true,
  state,
github Gingernaut / Peridot / src / store / account.js View on Github external
createdTime: null,
    modifiedTime: null,
  }
}

// automatically generate operations
const getters = { ...make.getters(state) }
const mutations = {
  ...make.mutations(state),

  // setting the store back to it's initial state (logout, etc.)
  reset(s) {
    Object.assign(s, state())
  },
}
const actions = { ...make.actions(state) }

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions,
}
github Gingernaut / Peridot / src / store / ui.js View on Github external
import { make } from "vuex-pathify"

const state = {
  showNavbar: true,
  showFooter: true,
}

// automatically generate operations
const getters = { ...make.getters(state) }
const mutations = make.mutations(state)
const actions = { ...make.actions(state) }

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions,
}
github NarHakobyan / awesome-vue-boilerplate / src / store / helpers / default.helper.js View on Github external
export function makeActions(defaultState, ...actions) {
    const data = { ...make.actions(defaultState) };
    for (let d of actions) {
        Object.assign(data, d);
    }
    return data;
}
github pkkid / pushingkarma / src / store.js View on Github external
var makeModule = function(store) {
  return {
    namespaced: true,
    state: store,
    getters: make.getters(store),
    actions: make.actions(store),
    mutations: make.mutations(store),
  };
};
github pkkid / pushingkarma / src / store.js View on Github external
var makeModule = function(store) {
  return {
    namespaced: true,
    state: store,
    getters: make.getters(store),
    actions: make.actions(store),
    mutations: make.mutations(store),
  };
};