This is my Vuex getter:
const getters = {
getMovieById: state => id => {
debugger;
return state.movies.find(movie => movie.id === id);
}
};
I am importing the module in my component:
import movieMod from "../store/modules/movies";
I am storing the returned value of the getter in my reactive object:
movie = movieMod.getters.getMovieById(parseInt(props.id));
This is returning me the following function:
(id) {
debugger;
return state.movies.find(function (movie) {
return movie.id === id;
});
}