I read an example about getters in Vuex. Getters function has 2 parameters but only need to pass 1 parameter. What actually happen ? How do i write a custom function that have the same ability.
Delcaration:
getters: {
// ...
getTodoById: (state) => (id) => {
return state.todos.find(todo => todo.id === id)
}
}
Using:
store.getters.getTodoById(2)