This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
Lateinicus/frontend/src/containers/LevelList.ts
2018-10-02 16:04:38 +02:00

26 lines
690 B
TypeScript

import { connect } from "react-redux";
import { setLevelListLoading, setLevels } from "../actions";
import { ILevel } from "../models/level";
import LevelListPage from "../pages/levelList";
const mapStateToProps = state => {
return {
levels: state.levels,
loading: state.levelList.loading,
user: state.user,
};
};
const mapDispatchToProps = dispatch => {
return {
setLoading: (state: boolean) => dispatch(setLevelListLoading(state)),
setLevels: (levels: ILevel[]) => dispatch(setLevels(levels)),
};
};
const LevelListContainer = connect(mapStateToProps,
mapDispatchToProps)(LevelListPage);
export default LevelListContainer;