Created
July 4, 2019 10:43
-
-
Save skobba/dd1d69ee3ee0abd4fd37a9dc6571ce8b to your computer and use it in GitHub Desktop.
Recompose Pattern
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
| # Recompose | |
| A recompose stack is something like this: | |
| import * as R from "recompose"; | |
| const enhance = R.compose( | |
| R.withProps({text: "Click Me"}), | |
| R.withStateHandler({ active: false }, { | |
| onClick: ({ active }) => event => ({ | |
| active: !active, | |
| }), | |
| }), | |
| connect(mapStateToProps, mapDispatchToProps) // react-redux | |
| ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment