Skip to content

Instantly share code, notes, and snippets.

@davemackintosh
Last active September 27, 2019 13:30
Show Gist options
  • Save davemackintosh/22f6331b505361f2f9bbd8b23ec7f9a8 to your computer and use it in GitHub Desktop.
Save davemackintosh/22f6331b505361f2f9bbd8b23ec7f9a8 to your computer and use it in GitHub Desktop.
function compose(...composable) {
return (component) =>
composable.reduceRight((children, Composable) => {
return <Composable>{children}</Composable>
}, component)
}
// compose(withRouter, withMyHOC, withYourHOC)(MyComponent)
export default compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment