Home

Issue: 2814

Getter function context is undefined

[issue link]

I have getters for the state

but when i do the functional getters which i can pass params to it for querying

i instead get state and getters as undefined

export const state = () => ({
  cache: {},
  key: "PT-1"
});
export const getters = {
  cache: key => (state, getters) => {
    console.log(state, getters);
    return key ? state.cache[key] : state.cache[state.key];
  },
  games: (state, getters) => getters.cache() //(state.key ? getters.cache(state.key) : undefined) //getters.cache(state.key)
};
This question is available on Nuxt.js community (#c2442)