Files
bigcapital/client/src/connectors/TrialBalanceSheet.connect.js
2020-05-10 02:14:42 +02:00

24 lines
1012 B
JavaScript

import {connect} from 'react-redux';
import {
fetchTrialBalanceSheet
} from 'store/financialStatement/financialStatements.actions';
import {
getFinancialSheetIndexByQuery,
getFinancialSheetAccounts,
getFinancialSheetQuery,
} from 'store/financialStatement/financialStatements.selectors';
export const mapStateToProps = (state, props) => ({
getTrialBalanceSheetIndex: (query) => getFinancialSheetIndexByQuery(state.financialStatements.trialBalance.sheets, query),
getTrialBalanceAccounts: (sheetIndex) => getFinancialSheetAccounts(state.financialStatements.trialBalance.sheets, sheetIndex),
getTrialBalanceQuery: (sheetIndex) => getFinancialSheetQuery(state.financialStatements.trialBalance.sheets, sheetIndex),
trialBalanceSheetLoading: state.financialStatements.trialBalance.loading,
});
export const mapDispatchToProps = (dispatch) => ({
fetchTrialBalanceSheet: (query = {}) => dispatch(fetchTrialBalanceSheet({ query })),
});
export default connect(mapStateToProps, mapDispatchToProps);