あなたはどのようにこのアプローチについては、スタイルのpoint free
並べ替えを探している場合:
const R = require('ramda');
// sample data
const data = [{name: 'rod', age: 25}, {name: 'chuck', age: 30}, {name: 'rod', age: 50}];
// Alternative 1: bake in the name and vary the data
const filterByName = R.compose(R.filter, R.propEq('name'));
const filterByRod = filterByName('rod');
// now supply the data
filterByRod(data); // => [ { name: 'rod', age: 25 }, { name: 'rod', age: 50 } ]
// Alternative 2: bake in the data, and then vary the name
const filterDataByName = R.compose(R.partialRight(R.filter, [data]), R.propEq('name'));
// now supply the name
filterDataByName('rod'); // => [ { name: 'rod', age: 25 }, { name: 'rod', age: 50 } ]
、あなたの質問に上記2の代替を行うことを目指したと信じています。
はい、あなたは部分的にフィルタを適用したいと思いますが、データが最後に来るので、R.partialRightを使用できます - http://ramdajs.com/0.22.1/docs/#partialRight – arcseldon