30 lines
880 B
JavaScript
30 lines
880 B
JavaScript
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)
|