WIP / Features / Sate

This commit is contained in:
elforjani3
2020-07-27 02:39:26 +02:00
parent 56278a25f0
commit 4f2679592f
51 changed files with 4515 additions and 44 deletions

View File

@@ -0,0 +1,24 @@
import { connect } from 'react-redux';
import { getResourceViews } from 'store/customViews/customViews.selectors';
import {
getEstimateCurrentPage,
getEstimatesTableQuery,
getEstimatesPaginationMetaFactory,
} from 'store/Estimate/estimates.selectors';
function withEstimates(mapSate) {
const mapStateToProps = (state, props) => {
const query = getEstimatesTableQuery(state, props);
const mapped = {
estimateViews: getResourceViews(state, props, 'estimates'),
estimateItems: state.estiamte.items,
estimateTableQuery: query,
estimatesLoading: state.estiamte.loading,
};
return mapSate ? mapSate(mapped, state, props) : mapped;
};
return connect(mapStateToProps);
}
export default withEstimates;