Skip to content

higher-order functions #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
joaomilho opened this issue Mar 20, 2016 · 7 comments
Open

higher-order functions #2

joaomilho opened this issue Mar 20, 2016 · 7 comments

Comments

@joaomilho
Copy link

Ex1: This works

const higher1 = (fn) => fn
export default higher1(MyComponent)

Ex2: This doesn't

const higher2 = (fn) => (props) => fn(props)
export default higher2(MyComponent)

I suppose this is a tricky use case, but being able to leverage higher order functions (in this case to pre-manipulate props) is a common thing when coding with a more functional style.

Is there any workaround?

@wyze
Copy link
Owner

wyze commented Mar 24, 2016

Sorry for the lack of response. I tried messing with this tonight and I was able to get it working a little bit by assigning the anonymous functions of higher2 an id in the AST. I am still new to ASTs, but it is going to take a little more time to get this figured out the right way.

@wyze
Copy link
Owner

wyze commented Dec 12, 2016

Hey @joaomilho, if this is still an issue, can you try out the new release v1.1.0 and let me know. If its still an issue, please can you show input code and what you expect the output to look like please.

@wyze
Copy link
Owner

wyze commented Apr 26, 2017

Closing with lack of response. More than happy to reopen if this is still an issue.

@wyze wyze closed this as completed Apr 26, 2017
@insidewhy
Copy link

@wyze Just tested with version 1.1.1, the reported issue is still there, can you reopen this?

@wyze
Copy link
Owner

wyze commented May 10, 2017

Sure, do you have a small snippet of actual code you could provide and what the expected output is?

@wyze wyze reopened this May 10, 2017
@insidewhy
Copy link

The example @joaomilho provided still doesn't work. It's as trivial as you can make the issue.

@graingert
Copy link
Contributor

@wyze @ohjames is this related: #9 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants