Last active
July 16, 2017 06:57
-
-
Save ncuillery/ca13ec2f084ee4d3c02af493d80adb7c to your computer and use it in GitHub Desktop.
ReactEurope2017_5
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
const withLoader = Component => props => { | |
if (!props.ready) { | |
return <Loader />; | |
} | |
return <Component {...props} />; | |
} | |
// Usage in the previous example: | |
const enhance = compose( | |
connect(commentSelector), | |
withRouter, | |
withLoader, | |
) | |
const EnhancedComponent = enhance(WrappedComponent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment