lunch/js/containers/RecordLunchContainer.js

30 lines
880 B
JavaScript
Raw Normal View History

var connect = require('react-redux').connect;
var UserActions = require('../actions/UserActions');
var AttendeeActions = require('../actions/AttendeeActions');
var SuggestionActions = require('../actions/SuggestionActions');
var RecordLunch = require('../components/RecordLunch');
function mapStateToProps(state) {
return {
attendees: state.attendees,
popularAttendees: state.popularAttendees,
suggestions: state.suggestions,
popularSuggestions: state.popularSuggestions
}
}
function mapDispatchToProps(dispatch) {
return {
createAttendee: function(attendee) {dispatch(AttendeeActions.create(attendee))},
removeAttendee: function(attendee) {dispatch(AttendeeActions.remove(attendee))},
createSuggestion: function(suggestion) {dispatch(SuggestionActions.create(suggestion))}
}
}
module.exports = connect(
mapStateToProps,
mapDispatchToProps
)(RecordLunch)