1.0.2 • Published 7 years ago
hoc-compose v1.0.2
Single compose() function, taken from Andrew Clark's recompose library.
const composedHoc = compose(hoc1, hoc2, hoc3)
// Same as
const composedHoc = BaseComponent => hoc1(hoc2(hoc3(BaseComponent)))Install:
npm i -s hoc-composeExample usage:
import { compose } from 'hoc-compose'
// ... your code
export default compose(
withRouter,
withApi,
withStyles(styles)
)(MyComponent);Would be equivalent to exporting with:
export default withRouter(withApi(withStyles(styles)(MyComponent)));