Files
Eventment/app/containers/Events.js
2019-07-24 00:53:01 -04:00

20 lines
509 B
JavaScript

import { connect } from 'react-redux';
import { fetchEvents } from '../actions/events.js';
import { getEventsAsList } from '../selectors/events.js';
import Events from '../screens/Events.js';
const matchStateToProps = (state) => {
const events = getEventsAsList(state);
console.log('events:', events);
return { events };
};
const mapDispatchToProps = (dispatch) => ({
fetchEvents: () => dispatch(fetchEvents(dispatch)),
});
export default connect(matchStateToProps, mapDispatchToProps)(Events);