Skip to content

Instantly share code, notes, and snippets.

@skobba
Created July 4, 2019 10:43
Show Gist options
  • Select an option

  • Save skobba/dd1d69ee3ee0abd4fd37a9dc6571ce8b to your computer and use it in GitHub Desktop.

Select an option

Save skobba/dd1d69ee3ee0abd4fd37a9dc6571ce8b to your computer and use it in GitHub Desktop.
Recompose Pattern
# 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