How to use the vuex-pathify.make.getters 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
*
 * See comments for details
 */
import { make } from 'vuex-pathify'

const state = {
  foo: 1,
  bar: 2,
  baz: {
    value: 3
  },
}

const getters = {
  // creates redundant getters, for those who like them
  ...make.getters(state),

  // additional total function
  total (state) {
    return state.foo + state.bar + state.baz.value
  }
}

const mutations = {

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

  // additional increment function
  INCREMENT_FOO (state) {
    state.foo++
  }
github Gingernaut / Peridot / src / store / account.js View on Github external
id: null,
    firstName: null,
    lastName: null,
    emailAddress: null,
    token: null,
    phoneNumber: null,
    userRole: null,
    UUID: null,
    isVerified: null,
    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 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 NarHakobyan / awesome-vue-boilerplate / src / store / helpers / default.helper.js View on Github external
export function makeGetters(defaultState, ...getters) {
    const data = { ...make.getters(defaultState) };
    for (let d of getters) {
        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),
  };
};