File size: 534 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import {logout, fetchAllUsers} from '../../actions/session_actions';
import { connect } from 'react-redux';
import Greeting from './greeting';
const mapStateToProps = (state) => {
  const currentUserId = state.session.id ;
  return (
    {currentUser: state.entities.users[currentUserId],
    users:state.entities.users}

  );
};

const mapDispatchToProps = dispatch => ({
  logout: () => dispatch(logout()),
  fetchAllUsers: ()=>dispatch(fetchAllUsers())
});


export default connect(mapStateToProps , mapDispatchToProps)(Greeting);