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

invokeMap in fp strange behavior #3883

Closed
JesterXL opened this issue Jul 24, 2018 · 4 comments
Closed

invokeMap in fp strange behavior #3883

JesterXL opened this issue Jul 24, 2018 · 4 comments
Labels

Comments

@JesterXL
Copy link

JesterXL commented Jul 24, 2018

The 2nd example for invokeMap fp don't seem to work, but they work with regular lodash. Using v4.17.4 in Node 10.1.0 and tested in Chrome 67.0.3396.99 on Stackblitz. I'm having various challenges getting it to pass values to functions, so am wondering if this is related?

Regular Lodash:

// works
_.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort')
// [[1, 5, 7], [1, 2, 3]]

// works
_.invokeMap([123, 456], String.prototype.split, '')
// [[1, 5, 7], [1, 2, 3]]

FP Lodash:

// works
invokeMap('sort', [[5, 1, 7], [3, 2, 1]])
// [[1, 5, 7], [1, 2, 3]]

// fails
log(invokeMap([String.prototype.split, ''], [123, 456]))
// [undefined, undefined]
@JesterXL
Copy link
Author

Just checked, and it seems invoke has the same issue. I'm referring to these unofficial docs: https://gist.github.com/jfmengels/6b973b69c491375117dc

@jdalton
Copy link
Member

jdalton commented Jul 24, 2018

Hi @JesterXL!

The fp invokeMap method variant has a fixed arity of 2 (so no args param). We don't currently provide an invokeMapArgs form, however you can use convert to reconfigure it.

@jdalton jdalton closed this as completed Jul 24, 2018
@JesterXL
Copy link
Author

Ah, makes total sense, ok cool, thanks!

@lock
Copy link

lock bot commented Jul 24, 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 Jul 24, 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