mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
WIP/customers
This commit is contained in:
18
client/src/containers/Customers/withCustomers.js
Normal file
18
client/src/containers/Customers/withCustomers.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getCustomersItems } from 'store/customers/customers.selectors';
|
||||
import { getResourceViews } from 'store/customViews/customViews.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
const mapStateToProps = (state, props) => {
|
||||
|
||||
const mapped = {
|
||||
customersViews: getResourceViews(state, 'customers'),
|
||||
customers: getCustomersItems(state, state.customers.currentViewId),
|
||||
customersLoading: state.customers.loading,
|
||||
customerErrors: state.customers.errors,
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
|
||||
return connect(mapStateToProps);
|
||||
};
|
||||
Reference in New Issue
Block a user