Robert Brax Robert Brax - 6 months ago 12
Javascript Question

Parametrize a function

Is there any way to parametrize whereEq, so i can remove 'complete: true' and pass this information when calling the function in console log example below ?

let incomplete = R.filter( R.whereEq( { complete: false } ) )

console.log( incomplete( data ))


R.wrap could be helpful here.

let incomplete = R.wrap(R.filter, function(filter, array, isComplete) {
  return filter( R.whereEq( { complete: isComplete }), array )

incomplete(data, false);