Skip to content
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

FP-style functions don't accept non-functions as iteratees (Error: func is not a function). Regression? #2007

Closed
lolmaus opened this issue Feb 16, 2016 · 3 comments
Labels

Comments

@lolmaus
Copy link

lolmaus commented Feb 16, 2016

const arr = [{score: 1}, {score: 2}];

// This works:
_.map(arr, 'score'); // => [1, 2]

// This doesn't:
_mapFP('score')(arr); // => Error: func is not a function

// Works, but is ugly:
_mapFP(item => item.score)(arr); // => [1, 2]

This is a huge regression for me. Using strings/objects for iteratees has been one of the most important lodash features for me.

Now I'm trying to import lodash methods individually in order to minimize distro size. That forces me to replace chaining with flow, and flow needs FP-style lodash functions.

Compared to chaining, flow is a huge hit on readability by itself, and the inability to use objects/strings for iteratees makes it even worse! 😭 The longer the flow chain, the harder it is to read all those callbacks.

Please let FP-style lodash functions accept non-functions as iteratees. If this is planned, please add it to the roadmap, mentioning the target version number.

🙇

@jdalton jdalton added the bug label Feb 16, 2016
@lolmaus
Copy link
Author

lolmaus commented Feb 16, 2016

You rock!

When this will be on npmjs.org?

@jdalton
Copy link
Member

jdalton commented Feb 16, 2016

We just released a few hours ago and this bug isn't an immediate regression
so it'll be this evening or the next morning.

@lock
Copy link

lock bot commented Jan 19, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants