1 2 3 4 5 6 7
getters: { // ... getTodoById: state => id => { return state.todos.find(todo => todo.id === id); }; } store.getters.getTodoById(2); // -> { id: 2, text: '...', done: false }