UNPKG

bonsai-analyzer

Version:
33 lines (27 loc) 711 B
/* * @flow */ import type { Dispatch, State } from '../../utils/reducer'; import type { Props, DispatchProps, StateProps } from './ModuleTableHead'; import { connect } from 'react-redux'; import ModuleTableHead from './ModuleTableHead'; import { FilteredTable, SortedTable, } from '../../utils/actions'; const mapStateToProps = (state: State): StateProps => { return { filters: state.filters, sort: state.sort, }; }; const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => { return { onFilter: FilteredTable(dispatch), onSort: SortedTable(dispatch), }; }; export default connect<Props, {||}, _, _, _, _>( mapStateToProps, mapDispatchToProps, )(ModuleTableHead);