[Vuejs]-Type Error: context.getters.Function is not a function with Vuex

0👍

The test function you are passing to state.contacts.find should return a boolean. You are just comparing element.id == id but not returning anything.

So change it to:

export const contacts_getPersonById = state => id => {
  return state.contacts.find(element => {
    return element.id == id;
  });

};

or just

export const contacts_getPersonById = state => id => {
  return state.contacts.find(element => element.id == id);
};

Leave a comment