Created
February 8, 2017 10:58
-
-
Save watanabeyu/8f4bc7336ed9da0d2a1ee5dd227a9710 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { bindActionCreators } from 'redux'; | |
import * as meta from './meta' | |
import * as didMount from './didmount' | |
import * as session from './session' | |
/* export */ | |
export default dispatch => ({ | |
didMount:bindActionCreators(didMount.set,dispatch), | |
session:bindActionCreators(session,dispatch) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { bindActionCreators } from 'redux'; | |
import { connect } from 'react-redux' | |
/* actions */ | |
import actions from '../actions/index' | |
/* component */ | |
import App from '../components/app' | |
/* state to props */ | |
const mapStateToProps = (state, ownProps) => { | |
return { | |
meta:state.meta, | |
didMount:state.didMount, | |
session:state.session | |
} | |
} | |
/* dispatch proos */ | |
const mapDispatchToProps = (dispatch) => { | |
return { | |
actions:actions(dispatch) | |
} | |
} | |
export default connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(App) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment