You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
621 B
24 lines
621 B
import { connect } from 'react-redux'
|
|
import { ThunkDispatch } from 'redux-thunk'
|
|
import { AnyAction } from 'redux'
|
|
|
|
import { fetchGroups } from 'src/actions/directory'
|
|
import { getDirectoryGroups } from 'src/selectors'
|
|
import { AppState } from 'src/types'
|
|
|
|
import Directory from './directory'
|
|
|
|
const mapStateToProps = (state: AppState) => ({
|
|
groups: getDirectoryGroups(state),
|
|
})
|
|
|
|
const mapDispatchToProps = (dispatch: ThunkDispatch<AppState, void, AnyAction>) => ({
|
|
fetchGroups: () => {
|
|
dispatch(fetchGroups())
|
|
},
|
|
})
|
|
|
|
export default connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(Directory)
|