Files
bigcapital/client/src/store/customers/customers.selectors.js
2020-06-17 15:56:46 +02:00

11 lines
337 B
JavaScript

import { pickItemsFromIds } from 'store/selectors';
export const getCustomersItems = (state, viewId) => {
const customersView = state.customers.views[viewId || -1];
const customersItems = state.customers.items;
return typeof customersView === 'object'
? pickItemsFromIds(customersItems, customersView.ids) || []
: [];
};