Skip to content

Instantly share code, notes, and snippets.

@tuxsudo
Last active October 1, 2016 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuxsudo/c53c7782784bb47372f250101407497b to your computer and use it in GitHub Desktop.
Save tuxsudo/c53c7782784bb47372f250101407497b to your computer and use it in GitHub Desktop.
HoC Composition
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