Static GitHub Issues

[2814] Getter function context is undefined

prev: How to include .sss files? (sugarss)
next: nuxt pdfmake

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)
};
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2442">#c2442</a>)</em></sub></div>