Problem
We currently have no easy mechanism for functional composition. Therefore, it becomes harder to keep track when multiple HOC are used to wrap a component. This is going to be pretty common (using withRouter and withIon together, for example).
TL;DR:
Change this 🤢:
export default hoc1(config1, hoc2(config2, hoc3(config3)))(MyComponent);
To this 😇:
export default compose(
hoc1(config1),
hoc2(config2),
hoc3(config3)
)(MyComponent)
Solution
Create a simple utility compose, enabling functional composition.