Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Conversation

@henrikra
Copy link
Contributor

@henrikra henrikra commented Feb 2, 2018

I faced a problem when I was composing functions with Ramda
I used R.pipe but same applies for R.compose. Imagine simple React component called MyComponent

I want to export my component but I want to enhance it with code push like docs say like this:
export default codePush({})(MyComponent). This works and like is good ✅

But when I have multiple enhance function for example react-redux's connect function I would like then compose enhance functions with Ramda's pipe. So then my code would look like this

export default R.pipe(
  codePush({}),
  connect(),
)(Main);

This does not work because of the wrong type I just fixed. I get error from Ramda's types: 🛑

Argument of type 'Function' is not assignable to parameter of type '(x0: {}, x1: {}, x2: {}) => {}'.
  Type 'Function' provides no match for the signature '(x0: {}, x1: {}, x2: {}): {}'.

With my PR both ways work without a problem with TypeScript

Copy link
Contributor

@itoys itoys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for contributing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants