More integrated examples #660
-
It would be cool if there would be some area where common problems and there solution are collected or something like a translator/convertor if someone is coming from lodash or so. var users = [
{ 'user': 'barney', 'age': 36, 'active': true },
{ 'user': 'fred', 'age': 40, 'active': false },
{ 'user': 'pebbles', 'age': 1, 'active': true }
];
_.find(users, function(o) { return o.age < 40; });
// => object for 'barney'
// The `_.matches` iteratee shorthand.
_.find(users, { 'age': 1, 'active': true });
// => object for 'pebbles'
// The `_.matchesProperty` iteratee shorthand.
_.find(users, ['active', false]);
// => object for 'fred'
// The `_.property` iteratee shorthand.
_.find(users, 'active');
// => object for 'barney' const users = [
{ 'user': 'barney', 'age': 36, 'active': true },
{ 'user': 'fred', 'age': 40, 'active': false },
{ 'user': 'pebbles', 'age': 1, 'active': true }
];
R.filter(
R.and(
R.propSatisfies((prop => prop == true), 'active'),
R.propSatisfies((prop => prop == 1), 'age')
),
users) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I agree. Snippet documentation where we try to translate lodash Stackoverflow questions and lodash documentation examples to Rambda examples. Sounds nice and I like that it is covering a common case where developer has to make a choice for utility library. I cannot give timeline for this, but I will keep you posted for any progress I made. |
Beta Was this translation helpful? Give feedback.
I agree. Snippet documentation where we try to translate lodash Stackoverflow questions and lodash documentation examples to Rambda examples. Sounds nice and I like that it is covering a common case where developer has to make a choice for utility library.
I cannot give timeline for this, but I will keep you posted for any progress I made.