Types of Vuex using getters

1
import * as types from './types'
export default {

    // -=-=-==- OK -=-=-=-== //
    //return first item
    first(state, getters){
        return getters.list[0];
    },

    //retorn all itens from my api
    list: state => {
        return state.list
    },


    // -=-=-==- ERROR -=-=-=-== //

    //return first item 
    [types.FIRST](state, getters){
        //how change .all for types.all
        //return getters.[types.ALL][0] this exemple is worng
        return getters.all[0];

    },
    //retorn all itens
    [types.ALL]: state => {
        return state.list
    }

}
How do I use [type.ALL] inside another getter as in the example above, without the types I can access one getter inside another easily, but as I need to use the types I could not get a way to call the getter all inside list using [type.ALL]

    
asked by anonymous 14.03.2017 / 18:59

0 answers