mirror of https://gitlab.com/ceda_ei/sonzai.git
21 lines
507 B
JavaScript
21 lines
507 B
JavaScript
|
import { connect } from "react-redux";
|
||
|
import Subjects from "../components/Subjects";
|
||
|
import { addSubject, removeSubject } from "../actions";
|
||
|
|
||
|
const mapStateToProps = state => {
|
||
|
return {
|
||
|
subjects: state.subjects,
|
||
|
};
|
||
|
};
|
||
|
|
||
|
const mapDispatchToProps = dispatch => {
|
||
|
return {
|
||
|
addSubject: subject => dispatch(addSubject(subject)),
|
||
|
removeSubject: id => dispatch(removeSubject(id))
|
||
|
};
|
||
|
};
|
||
|
|
||
|
const SubjectsContainer = connect(mapStateToProps, mapDispatchToProps)(Subjects);
|
||
|
|
||
|
export default SubjectsContainer;
|