From 7a3d38f7ee958ad23d5b3cae5d84969840e7f68a Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Tue, 21 Mar 2017 19:46:17 -0700 Subject: [PATCH] add byId getter to customer store --- src/store/customers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/customers.js b/src/store/customers.js index 42f3000..3f6542d 100644 --- a/src/store/customers.js +++ b/src/store/customers.js @@ -15,6 +15,7 @@ export default { const diffTime = (new Date().getTime()) - state.updatedAt; return diffTime >= seconds * 1000; }, + byId: state => id => state.customers.find(customer => customer.id === id), }, mutations: { setCustomers(state, customers) {