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

rt-class doesn't work with lodash 4.5.0 #105

Closed
shaylh opened this issue Feb 20, 2016 · 7 comments
Closed

rt-class doesn't work with lodash 4.5.0 #105

shaylh opened this issue Feb 20, 2016 · 7 comments

Comments

@shaylh
Copy link

shaylh commented Feb 20, 2016

Looks like lodash's implementation of "_.pick" changed in 4.5.0, and now

_.pick({ foo: true }, _.identity)

returns an empty object.

Codepen example with lodash 3.10.0
Codepen example with lodash 4.5.0

:)

@nippur72
Copy link
Contributor

don't know how pick is used in rt, but perhaps it's enough to replace it with pickBy ?

Codepen with _.pickBy

@shaylh
Copy link
Author

shaylh commented Feb 24, 2016

Unfortunately no, because _.pickBy was only introduced in lodash 4.5.0.

@nippur72
Copy link
Contributor

I mean, is the new pickBy equivalent to the old pick ? If so, at we could a switch or something like that.

@nippur72
Copy link
Contributor

nippur72 commented Mar 7, 2016

any ideas about how to solve this issue? Today I spent a long time debugging why my classes weren't working ...

@shaylh
Copy link
Author

shaylh commented Mar 7, 2016

_({foo: true, bar: false}).transform(function(res, value, key){ if(value){ res.push(key); } }, []).value().join(' ');

A bit ugly, I guess it could be improved, though it does the work on both lodash versions :)

@sergio11
Copy link

I have the same problem. Could you close the issue? please :)

@idok idok closed this as completed Apr 6, 2016
@shaylh
Copy link
Author

shaylh commented Apr 16, 2016

@mariawix , can you please also update the NPM repository? :)

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

No branches or pull requests

4 participants