title: How do I call a getter from another getter in Vuex?
body: <p>Consider a simple Vue blog:<br/>
   I'm using Vuex as my datastore and I need to set up two <a href="https://vuex.vuejs.org/en/getters.html" rel="noreferrer">getters</a>: a <code>getPost</code> getter for retrieving a <code>post</code> by ID, as well as a <code>listFeaturedPosts</code> that returns the first few characters of each featured post. The datastore schema for the featured posts list references the posts by their IDs. These IDs need to be resolved to actual posts for the purposes of showing the excerpts.</p>
  
  <p><strong>store/state.js</strong></p>
  
  <pre><code>export const state = {
    featuredPosts: [2, 0],
    posts: [
      'Lorem et ipsum dolor sit amet',
      'Lorem et ipsum dolor sit amet',
      'Lorem et ipsum dolor sit amet',
      'Lorem et ipsum dolor sit amet',
      'Lorem et ipsum dolor sit amet',
    ]
  }
  </code></pre>
  
  <p><strong>store/getters.js</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>export default getPost = (state) =&gt; (postID) =&gt; {
    return state.posts[postID]
  }
  
  export default listFeaturedPosts = (state, getters) =&gt; () =&gt; {
    console.log(getters) // {}
  
    return state.featuredPosts.map(postID =&gt; getters.getPost(postID).substring(0, EXCERPT_LENGTH);
  }
  </code></pre>
  
  <p><strong>store/index.js</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import Vue from 'vue'
  import Vuex from 'vuex'
  import state from './state'
  import * as getters from './getters'
  import * as mutations from './mutations'
  
  Vue.use(Vuex)
  
  export default new Vuex.Store({
    state,
    getters,
    mutations
  })
  </code></pre>
  
  <p>According to the documentation, the <code>getters</code> parameter can be used to access other getters. However, when I try to access <code>getters</code> from inside <code>listFeaturedPosts</code>, it's empty, and I get an error in the console due to <code>getters.getPost</code> being undefined in that context.</p>
  
  <p>How do I call <code>getPost</code> as a Vuex getter from inside <code>listFeaturedPosts</code> in the example above?</p>