Skip to content

Instantly share code, notes, and snippets.

@webmasterdevlin
Created March 13, 2019 03:44
Show Gist options
  • Save webmasterdevlin/0e49e6e2a39098e4b1094593c59cda48 to your computer and use it in GitHub Desktop.
Save webmasterdevlin/0e49e6e2a39098e4b1094593c59cda48 to your computer and use it in GitHub Desktop.
Vuex Getters : src/store/modules/heroes/getters.js
import * as types from "../../types";
const getters = {
[types.GETTERS_INIT_HEROES]: state => state.heroes, // retrieves the current heroes array from the state
[types.GETTERS_INIT_HERO]: state => state.hero // retrieves the current hero object from the state
};
export default getters;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment