mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-10-30 15:50:04 -04:00
28 lines
667 B
JavaScript
28 lines
667 B
JavaScript
var connect = require('react-redux').connect;
|
|
|
|
var UserActions = require('../actions/UserActions');
|
|
var ErrorActions = require('../actions/ErrorActions');
|
|
|
|
var TopBar = require('../TopBar');
|
|
|
|
function mapStateToProps(state) {
|
|
return {
|
|
user: state.user,
|
|
error: state.error
|
|
}
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
onLogin: function(user) {dispatch(UserActions.login(user))},
|
|
onLogout: function() {dispatch(UserActions.logout())},
|
|
onUpdateUser: function(user) {dispatch(UserActions.update(user))},
|
|
onClearError: function() {dispatch(ErrorActions.clearError())}
|
|
}
|
|
}
|
|
|
|
module.exports = connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(TopBar)
|