Files
Eventment/app/screens/Events.container.js
2019-08-05 21:23:17 -04:00

20 lines
500 B
JavaScript

import { connect } from 'react-redux';
import { fetchEvents } from '../actions/events.js';
import { getEventsAsList } from '../selectors/events.js';
import Events from './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);