An ES6 arrow function would work nicely here too. For example, sake, let’s say you’re looking for a particular ‘thing’ in your store.
new Vuex.Store({
getters: {
someMethod: (state) => (id) => {
return state.things.find(thing => thing.id === id)
}
},
})
Here is another example via the Vuex documentation