Last active
October 1, 2016 15:09
-
-
Save tuxsudo/c53c7782784bb47372f250101407497b to your computer and use it in GitHub Desktop.
HoC Composition
This file contains hidden or 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 compose from '@tuxsudo/compose'; | |
import {connect} from 'react-redux'; | |
import appendLifeCycle from '../hocs/append-life-cycle.js'; | |
import appendServerAction from '../hocs/append-server-action.js'; | |
import appendMetaDatas from '../hocs/append-meta-data.js' | |
import LandingTemplate from '../templates/Landing.js'; | |
export const finalComponent = compose( | |
// hook up all the things | |
connect(mapStateToProps(){}, bindActions(){}, mergeAllTheThings(){}), | |
appendServerAction((store, props) => { | |
// add static method which server recognizes and waits before responding | |
}), | |
appendMetaDatas((store) => { | |
// connect store data with an appended react-helmet instance | |
}) | |
appendLifeCycle({componentDidMount(){ | |
// dispatch injected data-grabbing actions | |
}), | |
)(LandingTemplate); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment